SCP magento – How to pass custom attribute values :
When you use SCP module for simple & configurable product, some time you have to pass your custom attribute values. Here i will explain how you want to pass your custom values. When you choose the configurable attribute dropdown the price and image or etc… of associate product values will change and it will show in frontend. SCP module will fetch all the information into one JSON when configurable product page load time. Whenever you choose the dropdown value then the value will chagen (like price or gallery or description or shortdescription). In this JSON you want to pass your custom values ? Yes we can, for this we have to check only two files, use below two files,
OrganicInternet\SimpleConfigurableProducts\Catalog\Block\Product\View\Type\Configurable.php
Here we will all the associated product id & detail, code like below
$childProducts[$productId] = array(
“price” => $this->_registerJsPrice($this->_convertPrice($product->getPrice())),
“finalPrice” => $this->_registerJsPrice($this->_convertPrice($product->getFinalPrice())),
“my_custom_attribute1” => 100,
“my_custom_attribute2” => 500
);
from the above code am passing two custom “my_custom_attribute1”, “my_custom_attribute2”. Value is 100 & 500.