Post Controllers

I have a product.post file but it does not seem to be triggered by products.options, should it be? The pre and post controllers documentation page is very limited. Is there are way to have something run after products.options?

Hello NottinghamDev,



Thank you for your message.



As far as I understand, you want to put some information right after the product options listed on the product details page in the storefront. In this case you can use the My changes add-on. You should create the following directories path in the root directory of your CS-Cart installation on the server:



skins/[CUSTOMER_ACTIVE_SKIN]/customer/addons/my_changes/hooks/products



where [CUSTOMER_ACTIVE_SKIN] is an active skin of your storefront. In this directory, you should create the product_option_content.post.tpl file with the necessary content which will be displayed above product options.



After this, go to Administration > Add-ons in your CS-Cart admin panel to make sure that the My changes add-on is installed and enabled. At the end you should clear the template cache. In order to do it, open this link in your browser: http://www.your_doma…om/admin.php?cc where www.your_domain.com is the address of your store, and where admin.php is a script file for the administration panel of your store, which was renamed for security reasons.



I hope this information will help you.



Thank you.





Pavel Zyukin

CS-Cart Support team

controller not template. I'm using my_changes/controllers/customer/products.post.php but it isn't being fired by dispatch=products.options

Hello NottinghamDev,



Thank you very much for the clarification.



In this case you should consider the options mode in your controller. It will look as follows (e.g.):


```php


if ($mode == 'options') {

...
YOUR PHP CODE
...

}

?>

```



After this everything should work as excepted. Please check it. If you still experience problems with this, I suggest that you should better contact us via Customer Help Desk and provide temporary access to your server by clicking on the Add record link on the Access information page of your Help Desk account so that we could examine the issue directly on your server.



Thank you.





Pavel Zyukin

CS-Cart Support team

The OP stated that product.post.php wasn't being called. That would be perfectly correct since the controller is products, not product. so if you have a addons/my_changes/controllers/customer/products.post.php I can guarantee you it will be called if your my_changes addon is Active.