Home Forums WC Vendors Pro Support get value of default shipping cost from wocommerce options

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #51074
    Stefan Bolboceanu
    Participant

    Hello!

    I imagine that this should be pretty easy but I am not being able to retrieve the value of the default national shipping fee which is set within the woocommerce/wcvendors admin options

    the problem is that if the vendor has not set any shipping fee, and neither they have disabled it nor set it to be free, then in the single product page on the shipping panel it won’t show the shipping costs, but then in the cart/checkout it will consider the admin default value to calculate the shipping costs..

    I think this could be quite confusing, and although I appreciate is a borderline possibility, I would like to code something which would pick the admin default shipping fee and display that in the product shipping details if the vendor hasn’t set anything.

    I know how to code this but I am not being able to retrieve the value of the default option from the admin settings.. 🙁

    many thanks in advance!

    #51097
    Anna
    Member

    Hello,
    I think you could gather this by using the info in the file: wp-content/plugins/wcvendors-pro/admin/class-wcvendors-pro-shipping.php
    Near line 500 I believe is where the check for admin rates begins.

    I do not have time to check this at the moment, but within that file you will find most of the admin shipping default code

    #51154
    Stefan Bolboceanu
    Participant

    Hello Anna,
    thanks for your help but I’m still stuck in the same way..

    in that class it simply assumes that they have the settings already into an array $this->settings and I cannot get my head around how would I retrieve the settings array for wcvendor’s shipping method..

    I think is a common woocommerce thing, because I’ve seen in other places that shipping options are normally retrieved as an array per shipping method.. though I don’t understand how I am supposed to get those packaged settings…

    #54855
    Stefan Bolboceanu
    Participant

    Any updates on this would be appreciated.
    Thanks in advance!

    #59256
    Nataliia Vernyhora
    Participant

    @CAKECOMPARE
    Hi Stefan!
    I’m struggling with the same issue, tried different options, but still can’t figure out how to show admin Shipping rates on a product page in case when a vendor forgot to add a shipping rate. Do you have any ideas about this?

    #59302
    Anna
    Member

    Hello,
    Check the file: wp-content/plugins/wcvendors-pro/admin/class-wcvendors-pro-shipping.php
    These are likely what you need:

    $settings = array(
        		'national_cost' 				=> $this->national_cost, 
        		'international_cost'			=> $this->international_cost, 
        		'product_fee'					=> $this->product_fee, 
        		'shipping_system'				=> $this->shipping_system, 
        		'national_qty_override' 		=> $this->national_qty_override, 
        		'international_qty_override'	=> $this->international_qty_override
        	); 

    Vendor rates have _wcv_vendor before them, such as '_wcv_vendor_national'
    If the vendor default rate or a vendor product override rate is not found / present, the default rates, as shown above, will be used.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.