I need to create a list of SKU separated by commas (sku1,sku2) to use them in the frontend of the site as a global variable. I tried adding it as an attribute per product and I also tried to create a category then loading a collection in order to show the SKU on the page but it seems to be overkill considering I only need it for less than 10 products. I just need a textbox or textarea where the SKU can be stored and loaded in the frontend. Probably in the configuration catalog. Something like the System > Configuration > Advanced > Developer > Developer Client Restrictions text box. Since these need to be changed easily.
1 Answer
You can use System custom variables. You can set custom variables by navigating to 'System' > 'Custom Variables'
where you can set comma-separated text or HTML value also. You can access it in frontend with below code:
Mage::getModel('core/variable')->loadByCode('custom_variable_code')->getValue('text');
-
-
1
-
Used this instead: "$sku_var = Mage::getModel('core/variable')->loadByCode('instore_sku')->getValue('text');". It works great. Jun 22, 2018 at 9:17
-
1