SMFHacks.com

SMF Store => Support => Bugs => Topic started by: KKOG on February 01, 2021, 05:37:51 am

Title: Another error using the Alternative PayPall Address
Post by: KKOG on February 01, 2021, 05:37:51 am
Hi,

I have found another bug in the store software when using the Alternative PayPal Address to force a "Buy Now" option.

Using this option applies a Shipping Condition where the condition is based on Weight criteria even though the "Requires Shipping" option has not been ticked.  I have applied the previous workaround that overcomes the application of a Shipping Condition which s based on a $ or cost condition.

To overcome this we have had to revert back to the use of the cart.

Regards
Greg Ralph
KKOG Forum Admin
Title: Re: Another error using the Alternative PayPall Address
Post by: SMFHacks on February 01, 2021, 01:16:54 pm
Try this hotfix
Open Sources/Store2.php
In function CreatePayPalButton($basketid)
Find
Code: [Select]
// Lookup the item information

$dbresult = $smcFunc['db_query']('', "
SELECT
subscribe_cycle_times, subscribe_cycle_duration, subscribe_cycle_type,
second_paypal, productname
FROM {db_prefix}store_item
WHERE ID_ITEM = " . $cartRow['ID_ITEM'] );
$itemRow = $smcFunc['db_fetch_assoc']($dbresult);
$smcFunc['db_free_result']($dbresult);

if (!empty($itemRow['second_paypal']))
$business = $itemRow['second_paypal'];

Change to

Code: [Select]
// Lookup the item information

$dbresult = $smcFunc['db_query']('', "
SELECT
subscribe_cycle_times, subscribe_cycle_duration, subscribe_cycle_type,
second_paypal, productname, requireshipping
FROM {db_prefix}store_item
WHERE ID_ITEM = " . $cartRow['ID_ITEM'] );
$itemRow = $smcFunc['db_fetch_assoc']($dbresult);
$smcFunc['db_free_result']($dbresult);

if (!empty($itemRow['second_paypal']))
$business = $itemRow['second_paypal'];

if ($itemRow['requireshipping'] == 0)
$basketRow['totalshipping'] = 0;
Title: Re: Another error using the Alternative PayPall Address
Post by: KKOG on February 01, 2021, 05:52:06 pm
Hi,

Thanks for the hotfix.

Will this be added to a new release of the Store system?

Another workaround was to set the weight criteria to be between 0.01kg and 5.00kg instead of between 0.0kg and 5.0kg.

Cheers
Greg Ralph
KKOG Forum Admin
Title: Re: Another error using the Alternative PayPall Address
Post by: SMFHacks on February 01, 2021, 06:33:54 pm
Yes it will be if it works for you.
Title: Re: Another error using the Alternative PayPall Address
Post by: KKOG on February 01, 2021, 06:51:24 pm
Have tested the Hotfix with weight condition starting with 0 and the shipping condition value is still added to the price on "Buy Now" using alternate PayPal address

Cheers
Greg
Title: Re: Another error using the Alternative PayPall Address
Post by: SMFHacks on February 01, 2021, 07:08:45 pm
Can you take a screenshot of your shipping settings and your item settings that has this issue.
Title: Re: Another error using the Alternative PayPall Address
Post by: KKOG on February 01, 2021, 07:33:04 pm
Hi,

Attached is the screenshot

[attachimg=1]

The offending condition is the between 0.00 and 5.00 kgs condition

Cheers

BTW what is the image attachment mod that you are using?