Hide paypal express button unless free shipping

  • Posts: 82
  • Thank you received: 8
  • Hikashop Business
9 years 5 months ago #205447

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1

Hi
There are many forum posts about the paypal express plugin not picking up the shipping cost so my solution is to only use paypal express if an order qualifies for free shipping - if it doesn't then make the user register etc then checkout with the normal paypal plugin.
I have added this code to my components/com_hikashop/views/checkout/tmpl/cart.php file

Find the lines approx LINE 460

<td class="hikashop_cart_total_value" data-title="<?php echo Jtext::_('HIKASHOP_TOTAL'); ?>">
						<span class="hikashop_checkout_cart_final_total">
						<?php
							echo $this->currencyHelper->format($this->full_total->prices[0]->price_value_with_tax,$this->full_total->prices[0]->price_currency_id);
						?>
						</span>
					</td>
				</tr>
Add an additional <tr><td> underneath then add the following code into the <td>
<?php if ($shipping_price == "0") { echo "You may use Express Checkout";} ?>  </br> <?php if ($shipping_price > "0") {
?>
<style type="text/css">#paypal_express_button{
display:none;
}</style>
<?php
} ;?>

Last edit: 9 years 5 months ago by huwhuw.

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 5 months ago #205451

Hi,

I suppose that you have different shipping methods between the free shipping and the non free shipping.
In your payment methods, you can select the shipping methods for which you want the payment method to display in the restrictions area.
So this shouldn't need any code modification.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum