I'd like to add a "Reorder" button to the previous orders (store:orders) in Store so when a user clicks the button that same item, quantity and modifiers will be placed in to their shopping cart. I've cobbled together the following but it loads slowly, the modifiers don't work as the {modifier_input_name} tag doesn't exist in the {items} tag and it only seems to process the first four of the {exp:store:product} tags. Is there a better way to do this?
Order history template:
{exp:store:orders member_id='CURRENT_USER' order_by='order_date' sort='desc'}
{items} {title}
{embed="includes/order_history_reorder" entry_id="{entry_id}" hidden_fields="<input type='hidden' name='item_qty' value='{item_qty}' class='item_quantity' />{modifiers}<input name='UNKNOWN' value='{modifier_value}' type='hidden'>{/modifiers}" }
{/items}
{/exp:store:orders}
includes/order_history_reorder template:
{exp:store:product entry_id="{embed:entry_id}" disable_javascript="yes"}
{embed:hidden_fields}
<input type="submit" name="submit" class="submit-button" value="{lv_reorder_text}" />
{/exp:store:product}