Category page 'add to cart' not working and changing lexicon entries

Hi,

I’m setting up SimpleCart which is going pretty well so far. Paypal sandbox checkout works and I’m finding SC pretty easy to work with in general.
I have come up against one issue so far that i can’t figure out…

  1. The ‘add to cart’ button on the category page is not updating the cart. I have tested this just using the SC chunks and still can’t get it to work.
    My form part of the scProductOverviewItem chunk is:

[[!scAddProduct]] <form action="[[~[[*id]]]]" method="post"> <div> <input type="hidden" name="productid" value="[[+id]]" /><!-- not needed on product detail pages itself --> <div class="row"> <div class="two columns"> <input type="text" name="quantity" value="1" /> </div> <div class="nine columns offset-by-one"> <input type="submit" name="addcart" value="Add to Cart" /> </div> </div> </div> </form>

The above chunk is being called from a Categories template like this:
[[!getPage?
&element=getResources
&cache=1
&showHidden=1
&parents=[[*id]]
&tpl=myscProductOverviewItemCategory
&sortby=menuindex ASC, id
&sortdir=ASC
&limit=12
&includeContent=1
]]

  1. I also want to change a few things on the form and elsewhere on the site. For instance i want to change ‘zipcode’ on the form to the UK ‘postcode’. Can i just change this on the form or do i need to make the change elsewhere?
    I also want to change some of the text, eg the word ‘Contribute’ that displays on the cart page…do i change this in the lexicon file? And if so will this get overwritten upon upgrade?

Apologies if i’m overlooking any information in the SC docs…please feel free to point me to the correct page if i have.

Thanks for any help

Janice

Hi Janice!

The form itself looks good to me. You wont need to include [[!scAddProduct]] within the chunk, that just needs to be one the page once.

The only reason it isn’t working that I can come up with right now is that perhaps there’s a redirect removing the POST values from the request? Or [[+id]] is not a simplecart product resource?

Thanks for your reply.
I only have the [[!scAddProduct]] in the chunk and nowhere else…so presumably i need it there in order to enable ‘add to cart’ functionality?
Sorry but how would i go about investigating those two options?
Where would i look for a redirect…there isn’t one associated with any form on the category template or chunk being used. There is a redirect in the product chunk to the cart page.
All products are displayed in the category resource just as they are in the modmore demo so the [[+id]] would be correct would it not?

The issue appears to be with the &cache=1. Once that was removed the ‘add to cart’ function works on the category page.