Skip to content

Instantly share code, notes, and snippets.

View maximspokoiny's full-sized avatar

Maxim Spokoiny maximspokoiny

  • Freelance
  • Everywhere
View GitHub Profile
@maximspokoiny
maximspokoiny / gist:34ad60ad90944f8a80c6fc093873a807
Created May 8, 2016 19:30
Fix js_composer element render function
/**
* Convert html into correct element
* @param html
*/
html2element: function(html) {
var attributes = {},
$template;
if (_.isString(html)) {
this.template = _.template(html);
$template = $(this.template(this.model.toJSON(), vc.templateOptions.default).trim());
@maximspokoiny
maximspokoiny / gist:2ef748f743f8e51618fa463eb23d8de4
Created April 19, 2016 14:20
magento update configurable product error
$product->getTypeInstance()->setUsedProductAttributeIds(array(92)); //attribute ID of attribute 'color' in my store
$configurableAttributesData = $product->getTypeInstance()->getConfigurableAttributesAsArray();
$product->setCanSaveConfigurableAttributes(true);
$configurableProductsData = array(//... ); //there data with new id's
$product->setConfigurableProductsData($configurableProductsData);