• Resolved phantolino

    (@phantolino)


    First of all i would like to thank you for this great plugin!

    I have 2 issues with it that unfortunately stops me from fully using it:

    1. The Product availability when item is out of stock and backorders are allowed field doesnt seem to work, whatever you choose in the Inventory tab in the product page (allow back orders, allow backorders and notify customer – while setting the product that to available), the product shows as available in the XML and gets the Y value.

    2. The Generate XML Now button doesn’t work, it shows a blank lightbox which does nothing – i noticed, using the developer tools of my browser, that i get an ajax error when the button is pressed.

    I tried all the above with a clean installation of wordpress using the latest version of WordPress 4.3 and latest Woocomerce 2.4.5 with the Storefront theme.

    Can you please help?

    https://wordpress.org/plugins/skroutzgr-xml-feed-for-woocommerce/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter phantolino

    (@phantolino)

    I also wanna add that the XML File Generation Interval option doesn’t seem to work as well. I added some new products and set it to 30 minutes and my xml didn’t change at all.

    Plugin Author Panagiotis Vagenas

    (@panvagenas)

    Hi phantolino,

    Thank you for your feedback!

    1. The Product availability when item is out of stock and backorders are allowed field doesnt seem to work, whatever you choose in the Inventory tab in the product page (allow back orders, allow backorders and notify customer – while setting the product that to available), the product shows as available in the XML and gets the Y value.

    I can confirm that. A patch will be available ASAP.

    2. The Generate XML Now button doesn’t work, it shows a blank lightbox which does nothing – i noticed, using the developer tools of my browser, that i get an ajax error when the button is pressed.

    It would help if you set WP_DEBUG to true and give more info about the error (browser, error details, etc).

    I also wanna add that the XML File Generation Interval option doesn’t seem to work as well. I added some new products and set it to 30 minutes and my xml didn’t change at all.

    I can’t confirm that, XML interval seems to work as expected. Please check created_at value in XML doc. Adding products to store doesn’t necessarily means they will be added to XML too (eg new products have missing fields). Also check Last XML Generation Log at the bottom of plugin settings page.

    Thread Starter phantolino

    (@phantolino)

    Thank you for your quick reply,

    The error i get for the Generate XML Now button is from the browser console:

    Uncaught Could NOT get verifier for key:___private_type___::©ajax.®ajaxGenerateSkroutzXML.

    I have enabled debuggin in wordpress but i didnt get any errors from there.

    As for the XML Interval i thought that it regenerates the xml from scratch, i will try to test it again and i will check what you suggested.

    Thread Starter phantolino

    (@phantolino)

    Forgot to mention that the problem with the Generate XML Now occurs only on Chrome, i just tested it on Firefox and it works!

    EDIT: It seems that the ajax error is random, i managed to get it working the first time with Firefox, i did some changes to my products and then when i tried to click it again the same error appeared on Firefox too…

    On the other hand the text in the lightbox (modal dialog) in Firefox works. In Chrome the text doesn’t appear, i think it is a CSS issue (the opacity maybe?).

    Thread Starter phantolino

    (@phantolino)

    It’s be again 😛

    Figured out a way to fix the problem about the backordered products, i reversed the logic that you get the woocommerce products availability in /classes/skroutz/skroutz.php at line 616.

    Here is the complete modified code:
    http://pastebin.com/5mXbZq53

    I hope this helps you, i tested it with every possible option and it works.

    Plugin Author Panagiotis Vagenas

    (@panvagenas)

    Thank you for your time phantolino but the logic in the snipet will fail if an item is avail through backordering but is in stock too.

    Try this one instead:

    $stockStatusInStock = $product->stock_status === 'instock';
            $manageStock = $product->managing_stock();
            $backOrdersAllowed = $product->backorders_allowed();
            $hasQuantity = $product->get_stock_quantity() > 0;
    
            if($manageStock){
                if($hasQuantity) {
                    return $this->©option->availOptions[$this->©option->get('avail_inStock')];
                } elseif(!$backOrdersAllowed) {
                    if ($this->©option->get('avail_outOfStock') == count($this->©option->availOptions)) {
                        return false;
                    }
                    return $this->©option->availOptions[$this->©option->get('avail_outOfStock')];
                } else {
                    if ($this->©option->get('avail_backorders') == count($this->©option->availOptions)) {
                        return false;
                    }
                    return $this->©option->availOptions[$this->©option->get('avail_backorders')];
                }
            } else {
                if($stockStatusInStock){
                    return $this->©option->availOptions[$this->©option->get('avail_inStock')];
                } elseif($backOrdersAllowed){
                    if ($this->©option->get('avail_backorders') == count($this->©option->availOptions)) {
                        return false;
                    }
                    return $this->©option->availOptions[$this->©option->get('avail_backorders')];
                }
            }
    
            return false;

    I will appreciate any feedback. Thanks again.

    Plugin Author Panagiotis Vagenas

    (@panvagenas)

    I consider this resolved as from the latest version

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Product availability when backorders allowed & Generate XML Now not working’ is closed to new replies.