• When I try to duplicate the product, every thing is duplicated accept for custom options.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Try to replace:

    
        add_action('delete_post', array($this, 'delete_post'));    	          		
      }	
    

    with:

    
        add_action('delete_post', array($this, 'delete_post'));
        add_action('woocommerce_product_duplicate', array($this, 'duplicate_product'), 10, 2);			          		
      }	
    
      public function duplicate_product($newProduct, $origProduct){
          $options = $this->getProductOptions($origProduct->get_id());
          foreach($options as $k => $option){
            $options[$k]['option_id'] = 0;
            foreach($option['values'] as $kk => $value){
              $options[$k]['values'][$kk]['value_id'] = 0;       
            }      
          }
          $this->getOptionModel()->saveOptions($newProduct->get_id(), $options);    
      }
    

    in the file:
    wp-content/plugins/product-options-for-woocommerce/Model/Observer.php

    Stanislav

    I’m having the same issue. If I do this won’t an update overwrite it?

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Yes, the updated version will overwrite it.

    You can add this code:
    https://stackoverflow.com/questions/17897044/wordpress-how-to-disable-plugin-update

    to disabled auto updates.

    Stanislav

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicate Product Not Copying settings of custom options’ is closed to new replies.