• Resolved albert0346

    (@albert0346)


    Hi,

    I tried to activate WooCommerce Smart COD and got the following error:

    “Parse error: syntax error, unexpected ‘[‘ in …/wp-content/plugins/wc-smart-cod/public/class-wc-smart-cod-public.php on line 106”.

    Please help.

    Thanks in advance for your help.

    Albert

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author FullStack-ing

    (@fullstackhouse)

    Hi Albert, thanks for contacting us,

    The reason you see this message is because you are using an outdated PHP version in your server ( < 5.4 ).

    We will release an updated version of the plugin with support for older PHP versions, later today.

    If you have the know-how, you can fix this by yourself, temporarily until our update.

    Please edit file wp-content/plugins/wc-smart-cod/public/class-wc-smart-cod-public.php

    replace line 106
    $package = $cart->get_shipping_packages()[0];
    with

    $package = $cart->get_shipping_packages();
    $package = $package[0];

    replace line 146
    $package = $cart->get_shipping_packages()[0];
    with

    $package = $cart->get_shipping_packages();
    $package = $package[0];

    Don’t hesitate to contact us for any question.

    Best Regards,
    FullStack Team

    Thread Starter albert0346

    (@albert0346)

    Hi Stratos,

    that’s phenomenal! ?? Such a quick and thorough answer!

    Thanks a lot.

    Albert

    • This reply was modified 7 years, 4 months ago by albert0346.
    Plugin Author FullStack-ing

    (@fullstackhouse)

    Hi Albert,
    Thanks for your comment.
    The update to support PHP versions < 5.4 is now released.

    Best Regards,
    FullStack Team

    Thread Starter albert0346

    (@albert0346)

    I activated the new version without problems.

    But I get the message “This field should be a number only.” when I enter 12,50 (“,” is used for Germany in the WooCommerce/General decimal delimiter settings) into the “Extra Fee” field. When I enter 12.50 I don’t get an error message. But shouldn’t it accept 12,50 for Germany?

    Albert

    Plugin Author FullStack-ing

    (@fullstackhouse)

    Hi Albert,

    The extra fee should work anyway, since the WooCommerce casts the cart price in a number value, so the “,” will become “.” at the end.

    Please confirm that it works correctly in the checkout page, otherwise we will update to allow the “,” delimiter as well.

    Best Regards,
    FullStack Team

    Thread Starter albert0346

    (@albert0346)

    Hi Stratos,

    YES, it works!

    Thanks!

    Albert

    Plugin Author FullStack-ing

    (@fullstackhouse)

    Nice ??

    If you liked the plugin, it will help us if you rate it.

    Thanks a lot Albert and have a nice day.

    Best Regards,
    FullStack Team

    Thread Starter albert0346

    (@albert0346)

    I tried now a purchase for the shipping zone Austria and not for Germany where the shop lives. As I understand it the plugin should now use the cost in the field “Extra Fee” and NOT the one in the field “Charge extra fee differently for shipping zone: Deutschland”. But it uses the cost from the field “Charge extra fee differently for shipping zone: Deutschland”.

    Please help.

    Albert

    Plugin Author FullStack-ing

    (@fullstackhouse)

    Albert that’s strange we just tested with the exact same scenario like yours and Austria gets the ‘extra fee’ field value and not the one you defined for Germany.

    Are you sure that Austria is not included in Germany’s shipping zone by mistake?
    Are you sure that Austria’s specific extra fee field is empty?

    If you are working on a live server, send us the url so we can try to debug this.

    Thread Starter albert0346

    (@albert0346)

    Sorry, sorry Stratos! ??

    I forgot in shipping zones in zone regions to select the specific countries. So it used as default Germany.

    Again, thanks a lot for your fast and proper help.

    Albert

    Plugin Author FullStack-ing

    (@fullstackhouse)

    Great Albert!

    If you liked the plugin, it will help us a lot if you rate it.
    Don’t hesitate to contact us for any question.

    Best Regards,
    FullStack Team

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Parse error when trying to activate WooCommerce Smart COD’ is closed to new replies.