Support » Plugin: WP-Lister Lite for eBay » Bug: Shipping discount profile wrong info

  • Resolved redjersey

    (@redjersey)


    I have two ebay accounts A and B, both have combined shipping discount defined on Ebay. A is added to the wp-ebay lister lite first.

    I have created a profile for A, listed a couple items, then created a profile for B. However in B’s profile, the shipping discount profile is loading from A, not B.

    I have tried updating by going to WordPress Ebay settings -> Accounts -> Refresh Details but it’s still can’t fix the problem

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @redjersey,

    First off, please make sure you added the new account and created the new listing profile the right way:

    In order to add another eBay site/user to your WP-Lister, the first thing you need to do is go to accounts, add a new account and connect to the eBay site with that account, the same way you did with your first account. Once you do that, you will want to go back to accounts and refresh your eBay details.

    Once you have done that, you will now need to create new listing profiles. Within the new listing profile, you will now notice a new section to the right labeled “Accounts”. Here you will click the radio button next to the new account then proceed to setup your listing profile. Once you have done that, you will then select listings and list them to eBay the same way you did before, but when you select the listing profile you will select the profile that is connected to the new account which is connected to the new eBay site/user.

    If that is what you did and you’re still having issues, please send us support ticket here – https://www.wplab.com/request-support/ so we can investigate the issue.

    Kind regards,

    Menchie
    WP-Lab Support

    This is a bug, or I should say it’s not implemented. Anyways I have created a support ticket. The problem is the ebay discount profile is always loaded from mysql table wp_options (name is wplister_ShippingDiscountProfiles) instead of wp_ebay_account (field is always empty)

    If you talk to your developer to look at /classes/core/EbayController.php line 416:

    // TODO: store ShippingDiscountProfiles in ebay_accounts table
    it will always loaded from wp_options, that’s why it’s not working.

    Hello redjersey.

    I have responded to your ticket you submitted to us. Let’s work this issue out in the ticket as I will need login credentials to your site to examine this more closely.

    Kind regards,
    John

    login info sent, thanks

    Not sure if you have a chance to look at this problem, but I think I have found the problem and have a proper fix of the issue.

    Issue: When there are multiple ebay accounts, the shipping discount profile info (fetched from ebay) did not save into
    wp_ebay_accounts table-> shipping_discount_profiles (this field is always empty), instead, it always use the value from wp_option option_name = wplister_ShippingDiscountProfiles. Since only 1 ebay account profile got saved into this field, when you try to load another profile for another ebay account, the incorrect shipping discount profile is loaded.

    Solution:
    I have temporary fixed this problem.

    1. Modify file classes/model/EbayShippingModel.php

    Find:
    WPLE()->logger->info( "downloadShippingDiscountProfiles()" );
    Before this line add:
    global $wpdb;

    Find:
    update_option('wplister_ShippingDiscountProfiles', $shipping_discount_profiles);
    Before this line add:

    //this will save the shipping discount profile to the associated wp_ebay_accounts entry
    $account_id = $session->wple_account_id;
    $table = $wpdb->prefix . 'ebay_accounts';
    $serialize_data = maybe_serialize($shipping_discount_profiles);
    $data = array('shipping_discount_profiles' => $serialize_data);
    $result = $wpdb->update( $table, $data, array( 'id' => $account_id ) );

    save the file.

    2. Modify file classes/page/ProfilesPage.php
    Find:
    $seller_return_profiles = maybe_unserialize( $account->return_profiles );
    After that line add:

    $shipping_profiles   = maybe_unserialize( $account->shipping_discount_profiles );
    if ( !empty($shipping_profiles) ) {
    	//get the shipping discount profile from wp_ebay_account
    	if (isset($shipping_profiles['FlatShippingDiscount'])) {
    
    		$shipping_flat_profiles = $shipping_profiles['FlatShippingDiscount'];
    	}
    	if (isset($shipping_profiles['CalculatedShippingDiscount'])) {
    		$shipping_calc_profiles = $shipping_profiles['CalculatedShippingDiscount'];
    	}
    }

    save the file.

    after making those changes, go to Ebay settings -> Accounts and click on Refresh Details

    that’s it! It will fix the problem. Note that this is a bandaid solution as it is not a good idea to save the account data in EbayShippingModel.php. It should be handled by classes/model/ebayaccount.php IMO

    I hope the developer can fix this issue in the next release or at least create a hook for that. Thanks

    • This reply was modified 1 year, 5 months ago by  redjersey.

    Hi @redjersey,

    Thank you for sharing the fix. This will be included in our next update.

    Kind regards,

    Menchie
    WP-Lab Support

    Plugin Author WP Lab

    (@wp-lab)

    This has been fixed in the latest update.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bug: Shipping discount profile wrong info’ is closed to new replies.