• Resolved archerindustries

    (@archerindustries)


    Hello,

    I like this plugin and how it works but why is it not set as a virtual product? Since it is just a code being generated, I should be able to add it to my shop (physical items being shipped) without it effecting my shipping methods.

    The gift certificate being classified as a physical product requires dimensions which generates shipping charges even though it won’t be shipped. Is there anything I can do about this? Thanks!

    https://www.ads-software.com/plugins/yith-woocommerce-gift-cards/

Viewing 7 replies - 1 through 7 (of 7 total)
  • thobri

    (@thobri)

    I have the exact same problem….

    Thx

    fressocoffee15

    (@fressocoffee15)

    Same issue for me as well.

    Plugin Author YITHEMES

    (@yithemes)

    Hi all,
    the latest version set the gift card as virtual by default.

    Best regards

    Thread Starter archerindustries

    (@archerindustries)

    Thanks for the fix! Well done!

    Plugin Author YITHEMES

    (@yithemes)

    I’m glad everything’s fine now. ??

    @yithemes

    Due to recent changes in WooCommerce 3.0.0, your fix is not working. To fix it, make sure you call the constructor in WC_Product_Gift_Card class before setting the internal product properties.

    In essence:

    FROM THIS:

    
      public function __construct( $product ) {
    
        yit_set_prop ( $this, 'product_type', 'gift-card' );
        yit_set_prop ( $this, 'virtual', true );
        yit_set_prop ( $this, 'sold_individually', false );
    
        parent::__construct ( $product );
    

    TO THIS:

    
      public function __construct( $product ) {
    
        parent::__construct ( $product );
    
        yit_set_prop ( $this, 'product_type', 'gift-card' );
        yit_set_prop ( $this, 'virtual', true );
        yit_set_prop ( $this, 'sold_individually', false );
    

    It seems parent constructor is resetting the properties.

    @yithemes

    And while you’re at it, you should also disable tax completely (or let the user decide it) because that’s supposed to be calculated according to what the user receiving the gift card decides.

    So for now, I patched your class and the constructor looks like this:

    
      public function __construct( $product ) {
    
        parent::__construct ( $product );
    
        yit_set_prop ( $this, 'product_type', 'gift-card' );
        yit_set_prop ( $this, 'virtual', true );
        yit_set_prop ( $this, 'sold_individually', false );
        yit_set_prop ( $this, 'tax_status', 'none' );
    
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘I am unable to set to virtual which causes shipping issues’ is closed to new replies.