Jump to content

Add To Cart Button Missing


Recommended Posts

Yes, everything has a quantity available, but still doesn't work.  Is there an image for the cart that could be missing?  Can I give someone access to my admin side to look?  I'm just frustrated beyond belief with this.  Ready to open my store, but obviously this Add to Cart function is a big show stopper.  I truly appreciate everyone's help on this.

Link to comment
Share on other sites

I'm not an expert but just trying to come up with some ideas. I REALLY don't grasp module positioning well yet BUT...

 

It's notable that neither your cart or your AddToCart button are being displayed.

 

Can you confirm that the cart module is actually "hooked"?

 

Go to Back Office->Modules->Positions. Select filter to Cart block.

 

You should see options for:

displayHeader

displayTop

  • Like 1
Link to comment
Share on other sites

It was hooked and now I've screwed it up even more, I think.  I unhooked it, thinking if I did that, I could hook it again.  Thought it was a disable/enable sort of function.  Now my website looks different.  Says I've added a product to my cart, which I haven't, and then there's nothing in the cart.  If I switch to a different theme, will all my products still be there and will this possibly fix any of this?  Thanks again!

Link to comment
Share on other sites

Think I was looking at site about the same time this happened. Noticed cart status I hadn't seen before over on left side of page above product. I saw Empty Cart w/ 1 product in it.

 

(1) Products are in database, safe from any cosmetic theme changes you make.

(2) You ought to be able to go to Back Office->Dashboard->ActiveShoppingCarts and delete any cart with screwball state.

 

How different does it look? Looks like you've gone into maintenance mode so I can't see site.

Link to comment
Share on other sites

Cart 0 Product Products (empty)

No products

Free shipping! Shipping
$0.00 Total

Check out

 

Product successfully added to your shopping cart
 
Quantity
Total
There are 0 items in your cart. There is 1 item in your cart.
Total products
Total shipping  Free shipping!
Total

 

 

All of that wasn't visible before, so I'm not sure what happened or what I did other than unhooking 1 of 2 cart blocks.  I don't know how to rehook the one I disabled. 

 

Also, it WAS in maintenance mode for some reason, but I've turned that off so the website is visible again. 

Link to comment
Share on other sites

There's something WAY wrong with your Cart Block module. The content that is showing on your page is normally in a pop-up window on my site after I add to cart.

 

Has your cart block always been on the left above the product? Has it ever been up top to the right of the search box? That's the default location. Are you using a customized theme or default? (It looks like default.)

 

If you have multiple themes installed (even a copy of your theme and/or the default theme), I would consider switching themes to see if the problem goes away with a different theme loaded. Switching themes should be painless; just a matter of going back and forth between the themes you have available.

 

If that doesn't clear the problem, I'd look at something a little more difficult. I've never done it before but what I would be considering is the idea of uninstalling the Cart Block module, re-installing it and re-hooking it. I know that's a lot and it feels risky but I'm not sure where else you go from here. Unfortunately, there a little of the blind leading the blind going on here.

 

The whole hooking process seems weird to me because you're selecting what pages you DON'T want it on but it looks like you managed to re-hook the modules in the right places. It just seems stuck in the add-to-cart pop-up view without the pop-up!

  • Like 1
Link to comment
Share on other sites

Okay, here's some valuable info. Just inspecting the buy-block-bottom division (where the AddToCart button SHOULD be). Noticed that this division is class "unvisible". If I turn off the display:none for that instance of class unvisible, guess what! The AddToCart button shows up where it's supposed to be!

 

So... somewhere along the line, that button class has somehow changed in the css files.

 

The presence (or lack thereof) of the AddToCart button is being caused by a style issue.

 

This doesn't solve the stuck open pop-up but it does point us in the right direction for the lost AddToCart button.

Link to comment
Share on other sites

RE: the stuck open pop-up

 

Here's what I would try:

 

(1) Unhook, re-hook Cart Block module (you may have been re-hooking it at an odd time while it was being accessed and maybe a file didn't get written properly. This would be the simplest solution, if it works.)

(2) Switch theme and see if problem goes away.

(3) Uninstall, re-install, re-hook Cart Block module.

Link to comment
Share on other sites

If you have the ability to access and edit your Prestashop files directly (cPanel:FileManager):

 

Look in folder /themes/your_current_theme/css/ for a file named "products.css".

Initially, VIEW (not edit) products.css.

Look through that file for "box-cart-bottom".

You're looking for any reason for that element to be assigned to class "unvisible".

 

If we can find that, THEN we'll edit the file to correct it but first we have to find it.

 

Once we find it, THAT is what we have to fix to re-enable the AddToCart button.

Link to comment
Share on other sites

The blurb below is long, but I highlighted a section in green where it says disable.  Is this what you were referring to?

 

.box-cart-bottom {
  -webkit-box-shadow: inset 0 6px 6px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: inset 0 6px 6px rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 6px 6px rgba(0, 0, 0, 0.05);
  padding: 19px 19px 17px; }

.box-cart-bottom {
  padding: 0; }

#short_description_content a,
.page-product-box a {
  color: #333333;
  text-decoration: underline; }
#short_description_content a.btn,
.page-product-box a.btn {
  text-decoration: none; }

.box-info-product {
  background: #f6f6f6;
  border: 1px solid #d2d0d0;
  border-top: 1px solid #b0afaf;
  border-bottom: 1px solid #b0afaf; }
  .box-info-product p {
    margin-bottom: 7px; }
  .box-info-product .exclusive {
    padding: 0;
    border-top: 1px solid #0079b6;
    border-right: 1px solid #006fa8;
    border-left: 1px solid #006fa8;
    border-bottom: 1px solid #012740;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    border-radius: 5px;
    position: relative;
    display: block;
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #009ad0), color-stop(100%, #007ab7));
    background-image: -webkit-linear-gradient(#009ad0, #007ab7);
    background-image: -moz-linear-gradient(#009ad0, #007ab7);
    background-image: -o-linear-gradient(#009ad0, #007ab7);
    background-image: linear-gradient(#009ad0, #007ab7);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#009ad0', endColorstr='#007ab7',GradientType=0 ); }
    .box-info-product .exclusive:before {
      font-family: "FontAwesome";
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      color: white;
      font-size: 25px;
      line-height: 47px;
      text-shadow: 0 1px #015883;
      content: "\f07a";
      z-index: 2;
      width: 51px;
      text-align: center;
      border: 1px solid #06b2e6;
      -webkit-border-radius: 5px 0 0 5px;
      -moz-border-radius: 5px 0 0 5px;
      -ms-border-radius: 5px 0 0 5px;
      -o-border-radius: 5px 0 0 5px;
      border-radius: 5px 0 0 5px; }
      @media (max-width: 991px) {
        .box-info-product .exclusive:before {
          display: none; } }
    .box-info-product .exclusive.added:before {
      content: "\f00c"; }
    .box-info-product .exclusive.added.disabled:before, .box-info-product .exclusive.disabled:before {
      content: "\f110";

      animation: 2s linear 0s normal none infinite spin;
      -webkit-animation: 2s linear 0s normal none infinite spin;
      -moz-animation: 2s linear 0s normal none infinite spin;
      border: none; }
    .box-info-product .exclusive:after {
      background: url(../img/border-1.gif) repeat-y 0 0;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 51px;
      content: "";
      width: 1px;
      z-index: 2; }
      @media (max-width: 991px) {
        .box-info-product .exclusive:after {
          display: none; } }
    .box-info-product .exclusive span {
      -webkit-border-radius: 5px;
      -moz-border-radius: 5px;
      -ms-border-radius: 5px;
      -o-border-radius: 5px;
      border-radius: 5px;
      font-weight: 700;
      font-size: 20px;
      line-height: 22px;
      border-top: 1px solid #06b2e6;
      border-right: 1px solid #06b2e6;
      border-left: 1px solid #06b2e6;
      border-bottom: 1px solid #06b2e6;
      text-shadow: 0 1px #015883;
      padding: 12px 36px 14px 60px;
      color: white;
      display: block !important;
      -webkit-transition: all 0.3s ease;
      -moz-transition: all 0.3s ease;
      -o-transition: all 0.3s ease;
      transition: all 0.3s ease; }
      @media (max-width: 1199px) {
        .box-info-product .exclusive span {
          padding: 12px 22px 14px 55px;
          font-size: 14px; } }
      @media (max-width: 991px) {
        .box-info-product .exclusive span {
          padding: 8px 12px 10px;
          text-align: left; } }
    .box-info-product .exclusive:hover {
      background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #007ab7), color-stop(100%, #009ad0));
      background-image: -webkit-linear-gradient(#007ab7, #009ad0);
      background-image: -moz-linear-gradient(#007ab7, #009ad0);
      background-image: -o-linear-gradient(#007ab7, #009ad0);
      background-image: linear-gradient(#007ab7, #009ad0);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#007ab7', endColorstr='#009ad0',GradientType=0 );
      background-position: 0 0; }
 

Link to comment
Share on other sites

No.

 

Put your mouse cursor just above the credit card logos, right-click and select Inspect Element. Depending on your browser, that should bring up a window on bottom of screen. You're looking for <div class="unvisible"> right before <div box-cart-bottom>. If you double-click the word "unvisible" and hit delete, then enter, you will remove the unvisible from box-cart-bottom and the AddToCart button will magically appear. THIS DOESN'T FIX ANYTHING. It just shows us what has to change.

 

I'm not sure where this assignment is coming from. I don't see it anywhere in the snippet above. Right now, that is the challenge. WHERE is box-cart-bottom getting assigned to class unvisible?

Link to comment
Share on other sites

I'm not where I can help dig (cell phone hot spot w/ iPad mini right now) but I'd be trying to learn how Prestashop builds the product page. Somewhere in that process is where the element is being set to unvisible. FYI, on my page, that same div container just says <div> without the class="unvisible" inside the <>.

Link to comment
Share on other sites

Has your cart block always been on the left between nav bar and breadcrumb menu? Has it ever been up top to the right of the search box?

 

If you're using default theme, it's odd that cart block is where it is, unless you intentionally moved it. Mine (based on default) is up top right of the search box. There may be another loose end here...

Link to comment
Share on other sites

From themes/your_theme/product.tpl (~line 387):

 

<div
{if
    (!$allow_oosp && $product->quantity <= 0) ||
    !$product->available_for_order ||
    (isset($restricted_country_mode) && $restricted_country_mode) ||
    $PS_CATALOG_MODE
} class="unvisible"
{/if}
>

 

There are 4 conditions that will cause the button to be set to "unvisible":

(1) If "allow out of stock purchase" is turned off and quantity is 0

(2) If product "available for order" is turned off

(3) SOMETHING to do with restricted country mode being turned on?

(4) Catalog mode is turned on

 

Assuming that your code says the same thing and that there's not a bug in the code (works for everyone else, right?), you need to figure out which of those conditions is causing the problem. I know some ways to isolate it but I don't know that I can tell you how to isolate it.

 

Check, double-check and triple-check those conditions!

 

Link to comment
Share on other sites

<div{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE} class="unvisible"{/if}>
<p id="add_to_cart" class="buttons_bottom_block no-print">
 

So that's my code...looks the same as yours, I believe. 

 

All my products have a quantity assigned to them, so it's not #1.

 

So, I looked at #2 and I understood this to mean that if there was no stock available, then it could be ordered.  So, YOU SOLVED MY PROBLEM!!!  I'm so thankful!!!  Thanks so much for your dedication to my problem! 

 

If I come across anything else that I can't seem to get, would it be ok if I sent you a message? 

 

Thanks again.  Happy Holidays!

Traci

Link to comment
Share on other sites

Yay! Ship it! Now go make lots of money!

 

One of these days, I'm going to finish loading my products and get my site finished up so I can do the same!

 

Sure. Don't know how much help I'll be (got lucky on this one) but I'm always glad to take a look when I have time. It's a good exercise for me to learn Prestashop and you know what they say about karma...

Link to comment
Share on other sites

  • 11 months later...
×
×
  • Create New...