Is there a way to refresh a tab that is based on a block when a product option is changed?
I have data that is based on product_code for display. But when a product_option is displayed, the block is not redrawn.
I have a html/smarty block that has code to display data based on what the product code of the product is. If page is loaded with ABC-S (small) if I change the option to large, the product_code changes to ABC-L but the block is not re-rendered so it can pick up the data for the correct product code.
Is there a block option or something else I can do to have it re-rendered when the product options are changed?
I moved this from a tab to a standard hook for the product.details page. I have JS that extends the value of the result_ids for the form associated with the option selector to append 'my_div' to it so it becomes: ""
I have my block of code as:
However, when the option is changed, the console log and the data show that the block has not been re-rendered.
It's critical for my work that I can get the div to re-render when the option is changed. The product_code and the option are both updated when a different option is selected. The data I display is in an array that is indexed by product_code. Hence when the product code changes I should be displaying the information related to the product_code (which could be none or an unordered list).
Try to add cm-ajax-force class on the script tag
Unfortunately makes no difference. Any other suggestions? I do notice that when changing the option, the request goes to yotpo.com versus the site url. So I'm going to assume this is a theme issue, not a site issue.
Thanks for the suggestion.