Example #1
0
// Product attribute  Start
if ($isChilds) {
    $attributes = array();
    $selectAtt = array(array(), array());
} else {
    $attributes_set = array();
    if ($product->attribute_set_id > 0) {
        $attributes_set = $producthelper->getProductAttribute(0, $product->attribute_set_id, 0, 1);
    }
    $bool = INDIVIDUAL_ADD_TO_CART_ENABLE ? false : true;
    $attribute_template = $producthelper->getAttributeTemplate($template_desc, $bool);
    $attribute_template->template_desc = str_replace("{property_image_scroller}", "", $attribute_template->template_desc);
    $attribute_template->template_desc = str_replace("{subproperty_image_scroller}", "", $attribute_template->template_desc);
    $attributes = $producthelper->getProductAttribute($product_id);
    $attributes = array_merge($attributes, $attributes_set);
    $selectAtt = $carthelper->getSelectedCartAttributeArray($cart[$cart_index]['cart_attribute']);
}
$totalatt = count($attributes);
$template_desc = $producthelper->replaceAttributeData($product_id, 0, 0, $attributes, $template_desc, $attribute_template, $isChilds, $selectAtt, 0);
// Product attribute  End
$stockaddtocart = "stockaddtocartprd_" . $product_id;
$pdaddtocart = "pdaddtocartprd_" . $product_id;
$applybutton = "<input type='button' name='apply' value='" . JText::_('COM_REDSHOP_APPLY') . "' onclick='javascript:submitChangeAttribute();' />";
$applybutton .= "<input type='hidden' name='task' value='changeAttribute' />";
$applybutton .= "<input type='hidden' name='cart_index' value='" . $cart_index . "' />";
$applybutton .= "<input type='hidden' name='product_id' value='" . $product_id . "' />";
$applybutton .= "<input type='hidden' name='view' value='cart' />";
$applybutton .= "<input type='hidden' name='requiedAttribute' id='requiedAttribute' value='' reattribute=''>";
$applybutton .= "<input type='hidden' name='requiedProperty' id='requiedProperty' value='' reproperty=''>";
$cancelbutton = "<input type='button' name='cancel' value='" . JText::_('COM_REDSHOP_CANCEL') . "' onclick='javascript:cancelForm(this.form);' />";
$template_desc = str_replace("{apply_button}", "<span id='" . $stockaddtocart . "'></span><span id='" . $pdaddtocart . "'>" . $applybutton . "</span>", $template_desc);