WordPress.org

Ready to get started?Download WordPress

Forums

plugins (4 posts)

  1. b.bishop
    Member
    Posted 1 year ago #

    Basically, what I need to do, is create a plugin that will “build” a URL on http://www.canpar.com/XML/BaserateXML.jsp, so that it passes the pieces, weight, destination, etc, into the URL. These values can be extracted via the $woocommerce global variable.

  2. bcworkz
    Member
    Posted 1 year ago #

    You'll need to establish the correct key names for both canpar and woocommerce, but for example, just making up key names here, do something like this:

    global $woocommerce;
    $url="http://www.canpar.com/XML/BaserateXML.jsp?pieces={$woocommerce['pcs']}&weight={$woocommerce['wt']}&address={$woocommerce['destination']}";

    If any conversions need to be done, do it before the $url assignment, using other variables to hold the converted values. You then would use cURL or similar to send the request and receive the returned values from the canpar site. Process the returned values as needed before returning the values yourself to the caller. This all would be inside a function called presumably from a woocommerce page that needed the data in the first place.

    If you haven't yet, also read Writing a Plugin. I hope this all makes sense. Cheers.

  3. TeresaRenee
    Member
    Posted 1 year ago #

    Have you built a plugin for Canpar for Woocommerce?
    If so can I buy it off you? Email me at teresa@designedtoconnect.com

  4. tonyn123
    Member
    Posted 8 months ago #

    I'd also be interested in purchasing a plugin for Canpar and Woocommerce. I've got this thread to notify via e-mail so send a response if anyone can point me in the right direction. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic