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 7 years, 2 months ago by redjersey.