-
Posts
991 -
Joined
-
Last visited
-
Days Won
3
Everything posted by PWaddict
-
That's great. Stripe Seamless Integration Stripe Payment Element PayPal Seamless Integration PayPal Standard Checkout PayPal Advanced Checkout
-
@bernhard Mollie is supported ONLY on 32 countries and half of them are required to have a minimum sales volume. You will instantly exclude potential customers from many countries including USA. More info here. Stripe is supported on 50 countries and PayPal on more than 200. I think it will be better if you create a system with external payment modules where the RockCommerce clients will be able to use your ready-made payment modules for Mollie, Stripe, PayPal or they can create their own for any other payment provider. I don't know if Mollie supports it but PayPal and Stripe supports seamless integration too. The user completes the payment without leaving the client's website which is by far the best solution. I'm still a Padloper 1 user and created my own modules to do that for PayPal and Stripe (I haven't released it yet).
-
Hello! How can I set access to superuser only to a field that is created programmatically and doesn't belong to any template? Here is the code of the field that is part of a process module where that field is accessed by a custom page under setup: $field = $modules->get('InputfieldText'); $field->attr('name', 'myfield'); $field->label = $this->_('My Field'); $field->attr('value', $this->myfield); $form->add($field);
-
[SOLVED] How to save fields on a Process page of a module?
PWaddict replied to PWaddict's topic in General Support
Thanks @poljpocket I've edited the code on my post above. -
[SOLVED] How to save fields on a Process page of a module?
PWaddict replied to PWaddict's topic in General Support
Thank you for the replies. @poljpocket yep I misunderstood it indeed but I figured it out. I had to make the Process module as ConfigurableModule even with no config fields so I can save the values from my programmatically fields of buildForm() to module's database field "data" by using getConfig() and saveConfig(). Here is a full code sample: <?php namespace ProcessWire; class ProcessModuleTest extends Process implements ConfigModule { public static function getModuleInfo() { return array( 'title' => 'My Process Module', 'summary' => 'Setup My Process Module', 'version' => 100, 'icon' => 'cog' ); } public function __construct() { parent::__construct(); $this->set('my_text_field_1', ''); $this->set('my_text_field_2', ''); } public function ___execute() { $form = $this->buildForm(); if($this->input->post('submit_save')) { $this->processForm($form); $this->session->redirect('./'); } return $form->render(); } protected function ___processForm(InputfieldForm $form) { $input = $this->wire('input'); $data = $this->wire('modules')->getConfig($this); $form->processInput($input->post); $data['my_text_field_1'] = $form->getChildByName('my_text_field_1')->val(); $data['my_text_field_2'] = $form->getChildByName('my_text_field_2')->val(); if(count($form->getErrors())) return; $this->wire('modules')->saveConfig($this, $data); $this->message($this->_('Saved My Process Module Settings')); } protected function ___buildForm() { $modules = $this->wire()->modules; $form = $modules->get('InputfieldForm'); $form->attr('id', 'ProcessModuleTest'); $form->attr('method', 'post'); $form->attr('action', './'); $field = $modules->get('InputfieldText'); $field->attr('name', 'my_text_field_1'); $field->label = $this->_('My Text Field 1'); $field->attr('value', $this->my_text_field_1); $form->add($field); $field = $modules->get('InputfieldText'); $field->attr('name', 'my_text_field_2'); $field->label = $this->_('My Text Field 2'); $field->attr('value', $this->my_text_field_2); $form->add($field); $submit = $modules->get('InputfieldSubmit'); $submit->attr('value', $this->_('Submit')); $submit->attr('id+name', 'submit_save'); $form->add($submit); return $form; } protected function getInstalledPage() { $admin = $this->pages->get($this->config->adminRootPageID); $parent = $admin->child("name=setup"); if(!$parent->id) $parent = $admin; $name = 'my-process-module'; $page = $parent->child("name=$name"); if(!$page->id) { $info = ProcessModuleTest::getModuleInfo(); $page = new Page(); $page->parent = $parent; $page->template = 'admin'; $page->name = $name; $page->title = $info['title']; $page->icon = $info['icon']; $page->process = $this; $page->sort = $parent->numChildren; $page->save(); } return $page; } public function ___install() { parent::___install(); // Process modules must call parent method $page = $this->getInstalledPage(); $this->message(sprintf($this->_('Installed to %s'), $page->path)); } public function ___uninstall() { parent::___uninstall(); // Process modules must call parent method $page = $this->getInstalledPage(); if(!$page->id) return; $this->message(sprintf($this->_('Removed %s'), $page->path)); $this->pages->delete($page); } } Then on the frontend I can get a field value like that: echo $modules->getConfig('ProcessModuleTest', 'my_text_field_1'); -
Hello! I'm trying to create a Process module where the fields need to be on the custom Process page (under Setup) instead of the module screen. Here is my code so far and the problem is that the value on the field doesn't getting saved. Any help? <?php namespace ProcessWire; class ProcessModuleTest extends Process { public static function getModuleInfo() { return array( 'title' => 'My Process Module', 'summary' => 'Setup My Process Module', 'version' => 100, 'page' => array( 'name' => 'my-process-module', 'title' => 'My Process Module', 'parent' => 'setup', ) ); } public function ___execute() { $form = $this->buildForm(); if($this->input->post('submit_save')) { $this->processForm($form); $this->session->redirect('./'); } return $form->render(); } protected function ___processForm(InputfieldForm $form) { $input = $this->wire('input'); $form->processInput($input->post); $this->message($this->_('Saved!')); } protected function ___buildForm() { $modules = $this->wire()->modules; $form = $modules->get('InputfieldForm'); $form->attr('id', 'ProcessModuleTest'); $form->attr('method', 'post'); $form->attr('action', './'); $field = $modules->get('InputfieldText'); $field->attr('name', 'my_text_field'); $field->label = $this->_('My Text Field'); $form->add($field); $submit = $modules->get('InputfieldSubmit'); $submit->attr('value', $this->_('Submit')); $submit->attr('id+name', 'submit_save'); $form->add($submit); return $form; } }
-
FontAwesome Upgrade ProcessWire's backend with the latest Font Awesome free icons (solid + brands). Install Link: https://github.com/PWaddict/FontAwesome Copy all files included in this module into new directory /site/modules/FontAwesome/. In the ProcessWire admin, go to Modules > Refresh. Click install for the Font Awesome module. IMPORTANT: The module has a duplicated folder of the core's InputfieldIcon module where only 2 files (icons.inc, InputfieldIcon.js) have been modified so you must select the InputfieldIcon version from Font Awesome module to load. To do that go to InputfieldIcon module screen by using search or refreshing modules (you will get the duplicated notification) and on the section "Module file to use" select the proper version and click on Submit button.
-
Hello! Let's say an admin is editing a product page that contains a quantity field with the value "10". During that time a user is completing an order with the product that currently the admin is editing and the quantity field value is changed programatically to "9". All good so far. Here is the problem: If the admin finished editing the page and press Save, the quantity field value will be changed back to "10" even though he didn't touched that value as that was the value when he opened the page to edit. How can I prevent this? How do you solve this issue?
-
Presale question: Multiple carts?
PWaddict replied to PWaddict's topic in ProcessWire Commerce (Padloper) Support
Nevermind, I just saw the following note on PadCart.module (Padloper 1) so I guess you can easily have multiple carts on both Padloper versions by duplicating PadCart.module and renaming it's Class and $dbname value ? 'singular' => false, // You can have multiple carts available EDIT: Probably, I will also have to duplicate more files like PadLoper.module, PadOrderProcess.php, PadOnePageCheckout.module and change their $this->cart values. -
Presale question: Multiple carts?
PWaddict posted a topic in ProcessWire Commerce (Padloper) Support
Hey, I have a presale question. Does Padloper 2 supports multiple carts? For example, one cart will only handle the physical products and the other cart only the digital products. I need those 2 carts to be separated. Is that even possible? -
[SOLVED] Padloper 1 - How to skip confirmation?
PWaddict replied to PWaddict's topic in Modules/Plugins
I'm posting the solution in case any old Padloper user still need this: Open PadOnePageCheckout.module and find the public function renderConfirmation() and place the following code before $out = ''; if($order->pad_paymentmodule == "ProcessWire\PaymentFree") { // just change this line to meet the conditions you would like to apply $orderId = $this->session->orderId; $url = $this->page->httpUrl; return $this->session->redirect($url . "process/" . $orderId . "/"); } -
Hello! Since the related forum is locked, I'm posting here in case any "Padloper 1" users can help. Has anyone figured out how to skip the confirmation and display the success message after pressing the "Procceed to Confirmation" button? This will be useful if there is no actual payment involved.
-
@horst I've added multi-language support on both signature fields and sent you a pull request.
-
I just installed the module on PW 3.0.229 and I chose the alt language as default but there is no redirect. EDIT: I had to do few more things to actually work: Add a page name to the default language on the Home page On Languages Support - Page Names module at "Default language homepage URL is same as root URL?" select "No - Root URL performs a redirect to: /name/"
-
Hello! If the editor accidentally don't make a whole word as bold and do something like this: "Lorem" and then make the "Lo" letters bold too "Lorem" (<strong>Lo</strong><strong>rem</strong>) on the site using $sanitizer->truncate() for a summary, that word will be displayed as 2 words like this: "Lo rem". Any idea how to fix this?
-
I found the solution with wireLangReplacements() function. /** * Replace "Missing required value" text ONLY on frontend * */ if($page->template->name != "admin") { wireLangReplacements([ 'Missing required value' => 'My replacement value', ]); }
- 1 reply
-
- 2
-
-
No, I'm getting just 1 email. I've only changed the 203 and 211 lines and everything seems to properly work. Thanks for the help.
-
@strandoo The above error text issue is caused by the 245 changed line.
-
@strandoo I changed the 211 line and now it works but if I try to submit the form without checking the reCAPTCHA I'm getting the error "InputfieldRecaptcha" instead of the "Failed reCAPTCHA input test" as it should be due to the following hook: $wire->addHookBefore('SimpleContactForm::processValidation', function(HookEvent $event) { $form = $event->arguments(0); $recaptcha = $form->get('recaptcha'); // add error if not pass the reCaptcha test if (!$this->input->post->{'g-recaptcha-response'}) { // attach an error to the field $recaptcha->error(__('Failed reCAPTCHA input test')); // it will be displayed along the field } });