• Hello,
    We have a webshop with products in different categories and sub-categories. Some of the categories only display a product on the site when there is only 1 product in this category. When you add another product to this category and select this category on the website, it gives the following rsponse:

    Parse error: syntax error, unexpected ‘$’, expecting ‘&’ or T_VARIABLE in /home/moriaanvintage.nl/public_html/shop/wp-content/themes/responsive-child/wpsc-products_page.php on line 7

    I also added a new categorie for testing purposes. Same problem.

    Does anyone have a solution?

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can you provide us with the content of the /home/moriaanvintage.nl/public_html/shop/wp-content/themes/responsive-child/wpsc-products_page.php file inside pastebin.com URL or similar so we can see what code you have in there?

    Thread Starter moriaanvintage

    (@moriaanvintage)

    Hi, thanks for the prompt reply

    here is a piece of the code:

    <?php
    global $wp_query;
    $image_width = get_option(‘product_image_width’);
    /*
    * Most functions called in this page can be found in the wpsc_query.php file
    */
    jQuery(function($) {
    $(“form.product_form, .wpsc-add-to-cart-button-form”).die(‘submit’).live(‘submit’, function() {
    return confirm(‘Proceed to Checkout?’);
    });
    });
    ?>

    Is this some custom code you’re using? I’m not super great at development but I don’t think you can just start calling jQuery within PHP like that.

    Thread Starter moriaanvintage

    (@moriaanvintage)

    The code was like this from the beginning.
    Some categories work fine and the products in these categories are displayed on the site.

    But some categories only diplay the product, when there is only 1 product in this category. When you add another product, the before mentioned error appears on the site.

    So, why does it only work fine for some categories?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What is this, a plugin?

    I think it is something to do with the WP-e-commerce plugin. Could you check if the plugin is updated and theme you are using supports the e-commerce plugin. Posting the question on the developer’s plugin page will get you a faster reply.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The code was like this from the beginning.

    It can’t have been because you would have had a syntax error from the beginning.

    Thread Starter moriaanvintage

    (@moriaanvintage)

    The code is part of the products_page.
    The plugin we use is WP-ecommerce.
    I am also going to post the problem on the wp-ecommerce site.

    Thanks for the advices so far.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘parse error in categories’ is closed to new replies.