Forum for discussing general topics related to Couch.
11 posts Page 1 of 2
Hi,

Is there any way to reorder products in the couch cart addon?

Thanks
Hi,

For now only the product names are used to set the sort-order - this appears to have the advantage of grouping 'variants' of the same product together in the cart even if the order in which they are added is not sequential.

Please let us know if this arrangement does not suit you and the alternative that you have in mind.

Thanks
Hi,
Thanks for the reply.

It would be nice to be able to choose the order products are listed in. Categories are not an issue as they can be different pages.

I guess this could be done be having a "sort order" next to the edit/delete/view buttons in admin, or a "sort order" field under the product name, the former would be preferable but the latter would also be manageable.
I apologize but I seem to have misunderstood your question.
I thought you meant the order in which products appear in the 'cart' itself (i.e. after clicking on 'Add to cart').

Products are essentially regular cloned pages so on the front-end they can be listed in any order (using cms:pages).
On the back-end, however, just like all other pages the sort order is currently only the publish-date in ascending order (i.e. newest first).

This is set to change in the next version of Couch where you'll be able to choose your own field to sort on.
Hi,

It is the front end I would like to be able to sort the product order, so when a new product is added I can choose where it appears in the list of products not too worried about the sort order in the checkout pages.
It is the front end I would like to be able to sort the product order
The products are listed on the front-end using cms:pages tag.
This tag supports an 'orderby' parameter that you can use to order the listing to suit you.
Please see http://www.couchcms.com/docs/tags-reference/pages.html for details about the 'orderby' parameter.

As an example, in the sample shopping cart application that accompanies the documentation, you'll find the following line in index.php that does the listing -
<cms:pages order='asc'>
<div class="row">
..

Add the 'orderby' parameter to it with the value of your choice.

Hope this helps.
yes and no :D
That allow me to sort all products by a common object (name, date etc) but does not allow to choose specifically which product is displayed 1st, 2nd, 3rd place etc
Well actually it does. You just need to settle on a particular field and then tweak its value to manipulate the listing.

For example -

1. In the admin-panel tweak the publish-date of the products (a difference of 1 min will also suffice). The product with the latest date will show up first (both in the admin-panel as well as on the front-end because publish-date is the default orderby field).

2. Or define a new field (say named 'my_order') of type 'text' and 'search_type' of 'integer'.
Edit each product and set this field to a number (e.g. the bigger the number the lowest the product will appear).
Now in the cms:pages tag set the 'orderby' parameter to our fiield e.g.
Code: Select all
<cms:pages orderby='my_order'>


Alternatively, we could have used 'nested_pages' for drag-n-drop ordering from admin-panel but I see that you are using 'folders' so this will need modifying your code - hence I am not recommending this option in your case.

Does this help? :)
Hmmmm, seems I am doing something wrong :)


I added
Code: Select all
    <cms:editable
        name='my_order'
        label='Order'
        type='text'
        search_type='integer'
    />

which has added the "order" field to the product in admin

Using the demo code from your docs, I then changed

Code: Select all
 <cms:pages order='asc'>

to
Code: Select all
 <cms:pages orderby='my_order'>


But I still cannot change the order of the products :cry:
ok, got it working using
Code: Select all
<cms:pages order="asc" orderby='my_order'>


Thanks KK :)
11 posts Page 1 of 2
cron