I tried add the code to my related product tpl.
The only thing found is the submit button does not work.
I changed code from:
Code:
{if $js_enabled}
<a href="javascript: document.orderform.submit()">
{include file="buttons/button.tpl" button_title="ADD ALL TO CART" style="button"}
</a>
{else}
{include file="submit_wo_js.tpl" value="ADD ALL TO CART"}
{/if}
to Code :
Code:
{if $js_enabled}
{include file="buttons/button.tpl" button_title="ADD ALL TO CART" style="button" href="javascript: document.orderform.submit()"}
{else}
{include file="submit_wo_js.tpl" value="ADD ALL TO CART"}
{/if}
Now the submit is working.
Looks like the original submit code can not pass the href to the button.tpl
My X-Cart version is 4.0.9, I did it in "related_products.tpl" and has some other changes to "related_products.tpl ". So the customer can fill the qty for each related product and add them to cart by one click.