PHP Functions
-
Hello,
I am using the Zakra theme with the woo commerce plug-in.
I am trying to add a function that displays in the shopping cart the amount that a customer must order in order to get free shipping.
This is a link to the instructions.
At the bottom of that page is a code that I show below.
When I follow the instructions and add that code to the functions PHP page I get an error”
of type E_PARSE was caused in line 375 of the file /home/tryal1/public_html/cartonbuiltmodels/wp-content/themes/zakra/functions.php. Error message: syntax error, unexpected ‘
. ”
Is there an error in the code?
Am I adding it incorrectly as to the location or something else?
Or is there something in the Zakra code that does not allow this to work properly?
<?php
add_action( ‘woocommerce_before_cart’, ‘wc_add_notice_free_shipping’ );
function wc_add_notice_free_shipping() {$free_shipping_settings = get_option(‘woocommerce_free_shipping_1_settings’);
$amount_for_free_shipping = $free_shipping_settings[‘min_amount’];
$cart = WC()->cart->subtotal;
$remaining = $amount_for_free_shipping – $cart;
if( $amount_for_free_shipping > $cart ){
$notice = sprintf( “Add %s worth more products to get free shipping”, wc_price($remaining));
wc_print_notice( $notice , ‘notice’ );
}}
?>Thank you for the time.
The page I need help with: [log in to see the link]
- The topic ‘PHP Functions’ is closed to new replies.