It may well work fine with Kirby 4 though, if edit that line and run composer upgrade, but might be best to wait a release of Merx that has been tested with Kirby 4.
Hello,
I’m trying to integrate Merx starterkit into a website. I’m also using webpack.
I’m getting this error : No route found for path: "shop/cart" and request method: "GET", I tried to change my /api/shop/${endpoint} to http://localhost:3000/api/shop/${endpoint} in my cart.js but that doesn’t work. Is this related to webpack’s files structure ?
Thanks a lot.
I’m trying to implement the Merx shop in an existing headless Kirby (v4). For context: I need one backend to store content for multiple subsites/projects. This includes a webshop which ideally can be build with Nuxt as frontend.
But Now I’m figuring out how Merx would would work in this setup… What I’m currently thinking about doing:
Add-to-cart adds the product/quantity as an object to cookies/localstorage in the frontend app.
When going to checkout I collect the data from the cookies/localstorage and proceed to the checkout.
I’ve figured out that if i fetch (post) the data to the cart via a custom api which returns cart()->add('theFormData') the data will be returned, but when the page is refreshed it’s gone. Thus my conclusion is to store it as cookie and handling the cart-data there before sending this collected data to the checkout (which I still need to figure out).
Anyone that can point me in the right direction? I’m struggling to understand the docs for this kind of approach.
In my site/config/config.php I basically used the code by @tobiasfabian but I seem to struggle with the placement of the functions. Or are there other files I have to edit?
I would like to second @mafleig 's question. I’m thinking about including a discount code in the starter kit, but I don’t understand what steps would be necessary in order to do that. The link to the example shop no longer works btw.
So the first question is: Will the starter kit perhaps get an update with the discount code soon?
If not, could you maybe provide some steps (for dummies like me) which changes would be necessary and maybe how the config of the Starterkit would look after implementing the above code?
PS.: I just implemented it in the most basic way (still: yay!) and wanted to report a minor issue: when the code has been redeemed, but the quantity for some reason is set back to zero, an error is thrown like this: “The sum of the cart must not be negative.”
I’m setting up a store with Stripe following the cookbook: Checkout with Stripe’s Payment Intents – Merx
Payment is successful but I get the following error. ‘Wagnerwagner\Merx\Merx::completePayment(): Return value must be of type OrderPage, Kirby\Cms\Page returned’. And I just can’t find any clue where to look or how to fix it. Anyone else?
One thing confuses me: on the order page, products are saved in a structure field with keys and IDs that both appear to be the product’s UUID. Is this a leftover from before UUIDs were used?
Hi @thguenther,
thank you for your continued trust in Merx. After checking the first post of this thread, I realized, that we missed to celebrate the 5th (!) birthday of Merx – how time flies.
Back to your question: Key and ID are the same in most cases. Most times, you add a product to the cart with $cart->add('new-shoes'). In this case key is set automatically to new-shoes in the background. When you later on add the same product (new-shoes) to the cart, the quantity is set to 2. This happens based on the key. In some cases, you do not want the quantity to be summed up. In these cases you can manually set the key to distinguish between product variants. There is an example in the following Product Variants Cookbook.
To summarize: ID ist the page id. Key could be any unique string.
sure, Merx also works with a single language page.
Remove languages => true from the config.php (or set it to false). To make use of german translations for error messages, you should set locale to de_DE.utf-8.
Not related to Merx, but a little bonus for better slugs: Set slugs to de
I have finished building my e-shop using the starter kit, purchased a license, and everything is going well! However, after several searches, I see that Merx does not handle VAT! The products on the site I am building are intended for the whole world, and I need to calculate VAT based on the destination country. I saw that VAT is a recurring issue, and not knowing much about it, I continued to develop the project. But now I really need to be able to calculate this VAT.
My simplest solution would be to simply redirect the visitor to the official Stripe payment page. I would lose the efficiency of this Merx “Cart” page, but I believe I have no other choice.
How could I go about doing this? I would like to redirect the product information: quantity, image, title, price, to redirect to a Stripe payment page. Do you know if there is an easy way to do this?
I’m sorry, I can’t really help you with this topic. I’ve never redirected the Merx cart to Stripe nor do I have deep knowledge of VAT handling.
I found out that you can use the Stripe API to create payment links. Maybe this will help.