I was wondering, is it possible to initiate two commands with one button? Let me clearify that:
I want to to make a page with some text, a field for the coupon code and a button that automatically adds a predefined product to the shopping cart along with a coupon code automatically applied to the price. I have tried something with the code below, but without success.
I would do this on the backend when the form is processed. I.e. put the product you want in the cart and then apply the coupon and return the user to wherever you want them to be.
I have a similar problem. I want to show a dashboard on home page when a user logs in. Is there any way to pass two result_ids and update them both with different contents?
Let's say, I have two divs in home page. I want to update one with the previous orders of the user and second with his profile when he logs in. When he logs out, it should show static content. This can be easily achieved by reload / redirect. I wanted to know if there is a way to do it using ceAjax.
Let's say, I have two divs in home page. I want to update one with the previous orders of the user and second with his profile when he logs in. When he logs out, it should show static content. This can be easily achieved by reload / redirect. I wanted to know if there is a way to do it using ceAjax.
Hello!
There is a redirect after login and logout, do you really need ajax? Anyway, you can return the variable used in these blocks in your controller and specify block IDs in the result_ids parameter.There is no need to specify which data goes to which block because blocks use certain variables that should be updated.
I'd just use standard html blocks with smarty support and let the block carry the logic on what to display depending on whether the user is logged in or not. Each would be conditional upon {$auth.user_id != 0} for a logged in user.