pass full variation object into script instead of parts

This commit is contained in:
Mike Jolley 2015-12-04 13:31:36 +00:00
parent 2c023a2847
commit b7d8091a44
3 changed files with 5 additions and 7 deletions

View File

@ -183,9 +183,7 @@
$form.find( 'input[name="variation_id"], input.variation_id' ).val( '' ).change();
} else {
$single_variation.html( template( {
price: variation.price_html,
availability: variation.availability_html,
description: variation.variation_description
variation: variation
} ) );
$form.find( 'input[name="variation_id"], input.variation_id' ).val( variation.variation_id ).change();
}

File diff suppressed because one or more lines are too long

View File

@ -16,15 +16,15 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<script type="text/template" id="tmpl-variation-template">
<div class="woocommerce-variation-description">
{{{ data.description }}}
{{{ data.variation.price_html }}}
</div>
<div class="woocommerce-variation-price">
{{{ data.price }}}
{{{ data.variation.variation_description }}}
</div>
<div class="woocommerce-variation-availability">
{{{ data.availability }}}
{{{ data.variation.availability_html }}}
</div>
</script>
<script type="text/template" id="tmpl-unavailable-variation-template">