Noor Dawod
Forum Replies Created
-
Forum: Plugins
In reply to: [YITH WooCommerce Gift Cards] Backend suggestionAnd please check this bug I reported yesterday:
Forum: Plugins
In reply to: [YITH WooCommerce Gift Cards] Backend suggestionGood to know ??
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] 3D SecurePremium addons is getting more and more ridiculous. Open Source to the rescue!
Forum: Plugins
In reply to: [YITH WooCommerce Gift Cards] Backend suggestionAlso, if you want to add/edit a gift card through the backend, why is it not possible to set the charge on the gift card? That’s like basic…
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' );
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.