wagnerwagner / merx

Merx is a plugin to create online shops with Kirby.
https://merx.wagnerwagner.de
102 stars 10 forks source link

Moving the product pages into a content subfolder #5

Closed leuys closed 4 years ago

leuys commented 4 years ago

In some rare cases, the sorting of the products can fail, due to the interference of other first level pages.

It would be nice, if the product pages could be moved into their own subfolder, instead of having them directly in the content root directory. For example if someone has set up a 'shop' page in the panel, all the product pages then go into this folder. Similar to the order pages.

Maybe having a option in the config.php, like: 'ww.merx.productsPage' => 'shop',

I tried moving them manualy and by the blueprint setup. It worked for displaying them properly in the frontend and panel, but a function in the cart.php of the plugin then doesn't seem to function anymore.

tobiasfabian commented 4 years ago

Product pages don’t have to be in the content’s root they can be everywhere.

If you want to add a product to the cart you have to provide the full id of the product page, e.g.:

<?php
$cart->add([
  'id' => 'shop/winter/accessoire/gloves',
]);
leuys commented 4 years ago

Ok thank you for the answer. I have found the issue in my code.