WordPress.org

Support

Support » Plugins and Hacks » AWD Weight/Country Shipping for WooCommerce » Duplicating a plugin for another shipping method

Duplicating a plugin for another shipping method

  • Hi,
    great great plugin! 🙂

    Could you please please make a duplicate (or tell me what to change) so it can be used it for another (similar) shipping method.

    I saw PozHonks said:

    You will have to duplicate the plugin by changing its name (e.g.: awd2.php) and names of some other functions to avoid conflicts.

    it would be super great if someone could do it for the rest of us sheep.

    All the best to you
    Marko

    p.s. it may be relatively easy for you, but is super hard for me (I tried for several weeks and still no success because of my stupid “trial and error” method) :-/

    http://wordpress.org/extend/plugins/awd-weightcountry-shipping/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Im also interested in something like this. I posted here before I saw this thread. I wonder if someone got the duplicate working…

    I duplicated shipping-awd.php and tried to enable it on the plugins page, but got the following fatal error:

    Fatal error: Cannot redeclare init_awd_shipping() (previously declared in awd-weightcountry-shipping/shipping-awd.php:28) in awd-weightcountry-shipping/shipping-awd_ems.php on line 296

    Any idea what I can try?

    I was able to enable the second instance by replacing init_awd_shipping with a unique entry (init_awd_shipping_2) but I cant see the new instance under the shipping tab in WooCommerce.

    Im totally going blind here. Please add if you have any ideas…

    Ok so I just noticed yet another thread with the same topic.

    Apologies for my duplication of threads.

    But would be nice to hear from anyone if they managed to make this work. Or if this may be in a future official release. Thank you.

    Sorry for the bump. Anyone have an idea on how to do this?

    I believe I have the duplicate version working, though its more of a quick fix that a solution:

    • duplicated the shipping-awd.php and renamed the duplicate shipping-awd-2.php

    • opened the file and did a find a replace ALL ‘awd_shipping’ => ‘awd_shipping_2’ to make them unique.

    • updated the tile on lines 3,35,37 – ‘AWD Weight/Country’ => ‘AWD Weight/Country (awd_shipping_2)’ this is just to help differentiate between them.

    —-

    I’ve repeated this 6 times for different postage classes (1st class, 2nd class, next day etc…), each time just updating the pending number to keep each version unique, seems to work so far in my tests.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Duplicating a plugin for another shipping method’ is closed to new replies.
Skip to toolbar