1

How can I get the date when the cart was last modified?

I am doing some AJAX stuff and I want to use the date string as a cache buster.

1 Answer 1

1

There's nothing in terms of template tags that will output modified date-time to grab on to as far as I know but there is a useful hook (store_cart_update_end) provided which will give you something to work with to grab the current date and time and output that to the template file (hidden). This will give you something to grab hold of client-side with AJAX.

3
  • I wish I knew what to do with your information.
    – Florian
    Commented Mar 28, 2013 at 20:24
  • Ha, sorry Florian. 'Hooks' are provided to allow you to intercept the process and do something at that point in the process. They're mainly aimed at developers but aren't that hard to work with. It would require maybe a small plugin just to grab that hook and output a value to the template. If you're comfortable with PHP then a small plugin should be doable. If not then it may be something you can outsource if you really need it. I can't think of another way to grab the modified date without this intervention unfortunately.
    – Ian Young
    Commented Mar 28, 2013 at 20:51
  • If you grab the users cart_id from the session you can query the exp_store_carts table and the date column to get the time. Commented Mar 28, 2013 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.