Jump to content

alexm

Members
  • Posts

    710
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by alexm

  1. @kongondo sorry about my long overdue response. I think there might be some confusion, unless I'm having a bit of a moment. When the customer buys from the store I wouldn't need to get their bank details, but they would need to have the store's bank details to make the payment to the store. Therefore there would be no need to have the ability to collect the customers bank details at checkout as they won't need paying. However the invoice template in general, whether it be that the customer checked out via 'invoice' payment or 'stripe' etc would probably be advisable to include the stores bank details for receiving payments. Hence, I would think that most people will want the ability to add their store's bank details on the store configuration so they can be displayed on invoices sent/or printed via the system so customers can make bank transfer payments. For no I have hard coded it ??
  2. Hey @kongondo hope all is well. Here's a little feature request that I think may tie in nicely, especially for those using PaymentInvoice as an option. A fieldset for Bank Account Details that would store Bank Name, Sort Code and Account Number. This could then be automatically displayed on invoices, which is more or less a necessity to have on invoice if you are offering people to check out using Invoice as the payment option. ??
  3. @kongondo no dice my end. Who knows.
  4. @kongondo wonderful stuff! Works a charm. Cheers as per usual ??
  5. @kongondo I was on php 8.0 I've just upgraded to 8.1 but still see the spaces. I did test 8.2 as well, but spaces still show. I wonder whether there's an unsanitised value getting passed to the number formatter somewhere. This would be my suspicion. I've tried str_replace with "£ " and "£ " as the needle neither works. Hence the suspicion. Haha ??‍♂️
  6. @kongondo Thank you! I'll take a look into it and report back.
  7. @kongondo Yes, I was playing around with some other idea and I've left this in with my haste! There is no requirement for that conditional whatsoever ?
  8. @kongondo sorry about all the questions... Continuing on with this discount solution I've made, I'm trying to show the discount code on the padloper-order page opposed to the order item. I've edited your PadloperProcessOrder::orderSaved hook to suit and when I edit the order page from the page tree I see that the discount code is saved to the text field however it doesn't display if I view the order page via the shop dashboard. I assume it's due to this rendering a customised page edit view, so wondering if there is an easy solution to get this custom field outputting on the shop's order page?
  9. If it's to use of anyone this thread covers how I've implemented a (currently hardcoded) discount code with the help of @kongondo. I can share more information if required, but this should defo get you in the right direction. The next job, when I get a mo, will be to look at making an add on to pull and update the discount code from for admins of the shop. I know that it's on the roadmap for development, so it depends whether I get round to that before this feature is released as part of the core package.
  10. @kongondo When using $padloper->getValueFormattedAsCurrencyForShop() there is a space after the £ symbol which I notice on the demo site too. Where might one remove this space so it displays as £10.00 rather than £ 10.00?
  11. @kongondo Legend! Ta. I did it like so if ($input->post->padloper_cart_products || $input->post->padloper_cart_remove_product || $input->post->discount_code) { $products = $input->post->padloper_cart_products; $rem_products = $input->post->padloper_cart_remove_product; $padloper->updateCart($products, $rem_products, $isRedirect = false); $discountCode = $sanitizer->text($input->post->discount_code); if (!empty($discountCode)) { if ($discountCode == "T/O-FF") { $session->set('orderDiscountCode', $discountCode); } else { $session->set('orderDiscountCode', $discountCode); } } $session->redirect($page->url); } Works a charm coupled with your example price update hook. I'll post link to this chat in the other topic where someone was asking for a solution ?
  12. Yeah, apologies on my part for being a bit wishy washy there bro. So... whilst I know there will be a future release with in-built discount codes, that I know is on your roadmap, in the meantime, I have a client who requires some very rudimentary discount code magic for one discount code. With this in mind, I'm trying to implement a discount code input field on my shop-cart.php page/template which calls $padloper->cartRender->editCart() and renders my custom site/templates/padloper/cart-edit.php file. I've added a field called "discount_code" within the form area which I was hoping would get posted on "update cart" submission so that I can then hook 'Padloper::updateCart' to simply grab the posted value from the 'discount_code' field perhaps like so within the hook. if (input()->post->discount_code) { $discountCode = sanitizer()->text(input()->post->discount_code); if ($discountCode == "T/O-FF") { wire('session')->set('orderDiscountCode', true); } } Then I know that in respect to this given session the customer/users discount code is valid I could then do something like: $this->addHookAfter('PadloperCart::getProductPrice', null, 'discountCodePrice'); function discountCodePrice(HookEvent $event) { $product = $event->arguments('product'); // get the product field with the price $stock = $product->padloper_product_stock; // grab the price $price = (float) $stock->price; # amend price if condition is met if (wire('session')->orderDiscountCode === true) { $price = 0.01 * $price; } $event->return = $price; } And it would apply the discount. I could be way off-piste, but I hopefully that gives you an idea of what I'm trying to achieve ??‍♂️
  13. @kongondo I'm trying to hook Padloper::updateCart so I can grab a discount code from an input field named 'discount_code' in cart-edit.php so I can set it to the users session if the discount code matches however I can't seem to hook this. It looks like it's hookable, but have tried hook, hookBefore and hookAfter and simply stuck a bd('Test') and wire('log') in there to check but not getting anything. Am I going about this the wrong way. It would be nice to show the user their discount in the cart before proceeding to checkout you see. Then I can hook PadloperCart::getProductPrice to apply the new product prices like in your example code.
  14. Got it $orderItem->padloper_order_line_item
  15. I can see that I can grab the title from this, but what would be the easiest way of outputting the price for each line item?
  16. Hey @kongondo should a copy of confirmation/invoice email be sent to the admin, as it doesn't appear to be working for us if so. It could be that I believe you are sending emails as the "store email address" and if this email address is managed by a service provider like Google, sending from that email will be rejected by google as it will have come from the server. So it might be a good idea to have two fields. One for "store email" and one for "send emails from" so you can choose an email address that is managed by the local mail exchanger. Just an idea as we don't seem to be receiving any confirmation emails at the moment, so don't notice when we are getting orders.
  17. @kongondo ?? Oh, looking at the code, I thought you code pass it an order page!! How embarrassing that it's that obvious. I genuinely want to bury my head!!! Sorry for wasting your time bro. Can I help with your documentation perhaps? I could add to it and you could correct my solutions as you go? ?
  18. @kongondo I can't seem to get orderLineItemsPages. Sorry about this. On the active/past orders page I have the following // where $order is the $order page object $orderLineItems = $padloper->getOrderLineItemsPages($order);
  19. @kongondo Apologies for slow reply!! Thank you so much
  20. @kongondo Yeah, I think it would be nice to be able to see the shipping and billing address on the order page at a glance, but as you say it would be interesting to get the others opinions. Also as I'm creating an active orders and past orders view for customers on their account dashboard and I can't currently see how I can get their billing and shipping address details from padloper_order. Is there a way of me grabbing the shipping and billing address for an order to output with relative ease?
  21. @kongondo ahhhh!! So delivered is actually so you can update when you have had confirmation of delivery, I'm with you now.
  22. Hey again @kongondo, I don't know whether I'm tired/burnt out at this hour, or if I'm missing something, but only the Country seems to show on the order page not the customer's full shipping and billing address (screenshot attached) But if you click "print invoice" the full address displays.
  23. Also... If you do mark as delivered and then confirm. when you come back to the order it still has the "Mark as delivered" action.
  24. Hi @kongondo Just a quick thought. "Mark as delivered" on orders would probably be better as "Mark as despatched"? Makes more sense. It's a nothing kind of point, but I do think it makes more sense. What say you?
×
×
  • Create New...