0
votes

I have added a product attribute (drop down Yes/No) and set default value "No"

than add a product and select "Yes" from drop down

than make duplicate that product, when new product create from duplicate, drop down value "yes" copy from previous product. I want drop down should have "No" value as I have set default value "NO" during creating attribute

enter image description here

1

1 Answers

0
votes

I did resolve this issue, it was simple, you just have to set the field to your own option while duplicating the product.

In my case I had to clear two fields, (Description and SKU) and I just added the following code whenever the on click function on duplicate button was called.

public function duplicate()
{
    $this->getWebsiteIds();
    $this->getCategoryIds();

    $newProduct = Mage::getModel('catalog/product')->setData($this->getData())
        ->setIsDuplicate(true)
        ->setSku(null)
        ->setId(null)
        ->setDescription(null)
        ->setShortDescription(null)
        ->setStoreId(Mage::app()->getStore()->getId());

    Mage::dispatchEvent(
        'catalog_model_product_duplicate',
        array('current_product' => $this, 'new_product' => $newProduct)
    );

And in your case you can call the appropriate function may be ->setGShopping($YourString) accordingly.

I hope this may solve your issue.