Post by Frescard » Wed Oct 21, 2015 9:14 am

I just set up my first opencart installation, and everything seems to work just fine, except for some minor detail — I cannot add anything to the cart...
It doesn't matter if I do it from a listings page or from the individual product page, once I click the "add to cart" button, there's a little delay (and "Loading" might flash on the button or the cart status), and then it goes back. No error message on the screen or in the log (php error logging is enabled).

I modified some of the template to hide certain elements (e.g. the model and price lines), but that was mainly on the product page, so I don't know if that would affect the cart function on the listing pages.

The site is here: http://popcorncafe.ca/shop
(All the configurations are done without the www prefix, so that is probably not the culprit.)

Newbie

Posts

Joined
Fri Oct 16, 2015 5:58 am

Post by uksitebuilder » Wed Oct 21, 2015 3:27 pm

I can see the site has been modded slightly (no search box)

You should re-upload the default files as there is no bug wit hthe add to cart function by default.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by pprmkr » Wed Oct 21, 2015 4:27 pm

Frescard wrote: I modified some of the template to hide certain elements (e.g. the model and price lines)
Commented out price : NOT OK -> causes div id product beiing commented out and as a result data is not send with button-cart click function.

Code: Select all

          <?php if ($price) { ?>
          <ul class="list-unstyled">
		    <!--
            <?php if (!$special) { ?>
            <li>
              <h2><?php echo $price; ?></h2>
            </li>
            <?php } else { ?>
            <li><span style="text-decoration: line-through;"><?php echo $price; ?></span></li>
            <li>
              <h2><?php echo $special; ?></h2>
            </li>
			-->
            <?php } ?>
            <?php if ($tax) { ?>
            <li><?php echo $text_tax; ?> <?php echo $tax; ?></li>
            <?php } ?>
            <?php if ($points) { ?>
            <li><?php echo $text_points; ?> <?php echo $points; ?></li>
            <?php } ?>
            <?php if ($discounts) { ?>
            <li>
              <hr>
            </li>
            <?php foreach ($discounts as $discount) { ?>
            <li><?php echo $discount['quantity']; ?><?php echo $text_discount; ?><?php echo $discount['price']; ?></li>
            <?php } ?>
            <?php } ?>
          </ul>
          <?php } ?>
Move --> 1 line lower after <?php } ?>

Then price is commented out, special or not.

But tax, points and discounts will be visible.

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by viethemes » Wed Oct 21, 2015 10:01 pm

Frescard wrote:I just set up my first opencart installation, and everything seems to work just fine, except for some minor detail — I cannot add anything to the cart...
It doesn't matter if I do it from a listings page or from the individual product page, once I click the "add to cart" button, there's a little delay (and "Loading" might flash on the button or the cart status), and then it goes back. No error message on the screen or in the log (php error logging is enabled).

I modified some of the template to hide certain elements (e.g. the model and price lines), but that was mainly on the product page, so I don't know if that would affect the cart function on the listing pages.

The site is here: http://popcorncafe.ca/shop
(All the configurations are done without the www prefix, so that is probably not the culprit.)
Because of https://en.wikipedia.org/wiki/Same-origin_policy, you should use one type url only www or non-www.

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by Frescard » Thu Oct 22, 2015 5:19 am

pprmkr wrote: Move --> 1 line lower after <?php } ?>
Thanks for the hint! I've modified it per your suggestions, and it now works.

But it seemed to have been more an issue of unbalanced brackets than a commented-out price, no?
Because once I move the comment-close tag, the price is still invisible, but the cart-adding works fine now.

Newbie

Posts

Joined
Fri Oct 16, 2015 5:58 am
Who is online

Users browsing this forum: No registered users and 38 guests