Jump to content

Combinations attributes available date


sanl

Recommended Posts



{if isset($groups)}
// Combinations
{foreach from=$combinations key=idCombination item=combination}
var specific_price_combination = new Array();
var available_date = new Array();
specific_price_combination['reduction_percent'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'percentage'}{$combination.specific_price.reduction*100}{else}0{/if};
specific_price_combination['reduction_price'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'amount'}{$combination.specific_price.reduction}{else}0{/if};
specific_price_combination['price'] = {if $combination.specific_price AND $combination.specific_price.price}{$combination.specific_price.price}{else}0{/if};
specific_price_combination['reduction_type'] = '{if $combination.specific_price}{$combination.specific_price.reduction_type}{/if}';
specific_price_combination['id_product_attribute'] = {if $combination.specific_price}{$combination.specific_price.id_product_attribute|intval}{else}0{/if};
available_date['date'] = '{$combination.available_date}';
available_date['date_formatted'] = '{dateFormat date=$combination.available_date full=false}';
addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity}, available_date, specific_price_combination, {$combination.attribute_wholesale_price});
{/foreach}
{/if}


{if isset($attributesCombinations)}
// Combinations attributes informations
var attributesCombinations = new Array();
{foreach from=$attributesCombinations key=id item=aC}
tabInfos = new Array();
tabInfos['id_attribute'] = '{$aC.id_attribute|intval}';
tabInfos['attribute'] = '{$aC.attribute}';
tabInfos['group'] = '{$aC.group}';
tabInfos['id_attribute_group'] = '{$aC.id_attribute_group|intval}';
attributesCombinations.push(tabInfos);
{/foreach}
{/if}

I found this two columns with combinations and combinations attributes. My problem: if my main product is out of stock i can see: delivery in 2 weeks, but if customer choose main product + attribute from combination, he can see added attribute available date. So in the result: I dont have main product and it takes 2 weeks to ship, but if customer choose main + accessorie it shows: 1 -3 days delivery.

 

I didnt find any info in product.js file so the problem in product. tpl yes? 

if ($product->quantity <= 0) { 
available_date['date'] = '{$combination.available_later}'; 
} else {
available_date['date'] = '{$combination.available_date}';

its my way, but it not works. Help me if u know how :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...