Home Forums WC Vendors Free Support Per Product Shipping and WP User Frontend Pro

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 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #3256
    mcgregormedia
    Participant

    I know this is isn’t strictly about WCV but it ties in with it – has anyone managed to get Per Product Shipping working with WP User Frontend Pro?

    I can get the form fields in place using WPUF action hooks and they’ll display saved data correctly but I can’t get it to save to the database. The code used to display the fields is the same as the backend, reformatted to use WPUF’s ul/li.

    A bit of background: we hacked PPS for the backend, getting rid of the country, state and postcode fields, leaving only cost per order and cost per item – we only ship to one country so it wasn’t necessary to have it all there. We also removed the jquery draggable form and added normal form fields – the draggable form is a nightmare to use on iOS devices. All the code for the removed fields is still in place in the save-to-database function, we only changed the function to display the form.

    It works fine from the backend, saving all the data correctly but it just won’t save from the frontend. Thanks in advance for any pointers you can give me.

    #3257
    WC Vendors Support
    Participant

    Post up a screenshot of your WPUF Form that shows the part of how you are asking for the Per Product Shipping price and I’ll see if anything looks “off”. Cant guarantee results, but I can sure give it a look!

    Ben

    #3262
    Jamie
    Keymaster

    Hello,

    Yes I got per product shipping with WPUF but I just have it set a ‘shipping’ price for x countries and that’s it. I hook into the WPUF actions for on save and edit and wrote a bunch of my own code to store the information directly into the PPS database tables.

    If this is the direction you want to go I can clean up the code and throw it up on GIST for you.

    cheers,

    Jamie.

    #3263
    mcgregormedia
    Participant

    Hi Ben, the form itself isn’t the problem – it’s adding form fields with exactly the same attributes as the standard PPS code. The issue is in my code that hooks into the wpuf_add_post_after_insert and wpuf_edit_post_after_update actions.

    Hi Jamie, that sounds pretty much like what I’m trying to do so it would be great if you could post that – I could then compare with what I have and see where I’m going wrong. Presumably you’re using nested foreach loops?

    Andy

    #3275
    Jamie
    Keymaster

    Hi Andy,

    My code allows you to have any name for your inputs, just make sure they all start with the same prefix as per my example they all start with ‘ship_cost’ + the two letter country code. Then you just add extra code into the wcv_pps_shipping_costs method to add or remove support for extra countries.

    Here is the gist.

    https://gist.github.com/digitalchild/dbf176a266e14a09ea3f

    cheers,

    jamie.

    #3280
    mcgregormedia
    Participant

    Hi Jamie,

    I can see that the function that actually updates/inserts into the database is pretty much identical to the original plugin function. This is what I’ve tried to do to, but keeping it as close to the original as possible, using the nested foreach loops.

    I actually solved the problem this morning – it turns out that $post_id wasn’t being passed properly and that’s why the update failed (it’s always the littlest things). But now I’m tempted to do it your way… *rubs chin*

    Many thanks
    Andy

    #3710
    topher
    Participant

    Hi Jamie, I have the sample code you provided working just fine but what I noticed is that if you add a cost and save it theirs no problem. But then you change your mind and try to remove it by just deleting the cost on the frontend it doesn’t pick up that change in the backend? Any thoughts?

    Thanks,
    Chris

    #7178
    ben007
    Participant

    All the senior developers there Salute to you all.
    I am kid learning PHP, and also trying to create a Marketplace on my Localhost and if its cool then dad says he will publish it online 🙂
    I saw this integration code (Hook), but I was wondering what file should I add or modify it to.

    Please if any of you Sir can help me out figure this.

    Thank you.

    #7179
    ben007
    Participant

    I have a setup created using WC Vendors, Per Product Shipping and WPUF.

    Tried a lot but couldn’t get the Shipping show on Front End.

    Please Help. Thank you once again.

    #7180
    WC Vendors Support
    Participant

    All the help you’ll get on this has been posted here already. We don’t write WPUF or PPS. If you cant figure out the code here, you would want to contact the author of WPUF for support or the author of PPS for support. (In reality, WPUF author is who you should be asking, as Woo won’t help you with WPUF problems either).

    #7182
    ben007
    Participant

    Ok. Thank you. All I wanted to know is where should I add the above mentioned code.

    Thanks.

    #7183
    WC Vendors Support
    Participant

    For WordPress, custom, code usually goes in your themes functions.php file. /wp-content/themes/yourtheme/functions.php

    99% of the time (if not more) any custom code will go here. It’s the WordPress way. 🙂

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