Jump to content

2 problems- always shows 2 in basket and stores puts everything on sal


The_4wd_Zone

Recommended Posts

Hi all,

 

I am running CC version 5.2.16 with the Foundation Skin.

 

First Problem- When you add an item to the basket it says it has only added one and shows the correct price. However when you view the basket or proceed to checkout the basket shows two of each item, when you try and update to 1 of each item in the basket it stays on two. I did a search and saw that someone with Version 6 had the same issue in IE and Google Chrome but not Firefox, I have tried all browsers and it makes no difference.

 

Second Problem- When i add items to the shop i leave the sale price section blank. In the store in all the items the prices display correctly but in he column on the right hand side of the screen when you are viewing all items within a category it shows all the products as sale items with the sale price as $0.00. I have tried making the sale price the same as the retail price however the items still appear on sale however now the sale prices just matches the retail price.

 

Any help would be good, im a coding novice so go easy on me.

 

Thanks in advance, Matt

Link to comment
Share on other sites

Ok, I'm watching the javascript for your site execute TWO instances of:

POST /shop/index.php?_g=ajaxadd

where POST is:

quantity=1&add=8

 

So, I have the javascript the browser pulled down from your site, and I will try to find where the second trigger is coming from.

 

Don't wait up for me.

Link to comment
Share on other sites

I've discovered that your installation is loading two copies of /foundation/js/cubecart.js and /foundation/js/cubecart.validate.js.

 

It's the cubecart.js that has the function to execute the ajax add to basket, coupled with cubecart.validate.js that calls that function when the form is submitted.

 

Also, /foundation/js/foundation.min.js is also getting loaded twice.

 

So, we need to find what code is using the template variable $BODY_JS and $JS_SCRIPTS. I fear that some code in CC5216 is responsible, whereas that code is not exactly the same in CC6.

Link to comment
Share on other sites

Found it -- I think.

 

Try clearing the cache. In admin, Maintenance, Rebuild tab, check Clear Cache and Submit.

 

In the (CC5216) file /classes/gui.class.php, near line 146, there is:

            //Put in the javascripts
            $js = glob('skins'.CC_DS.$this->_skin.CC_DS.'{js,scripts}'.CC_DS.'*.js', GLOB_BRACE | GLOB_NOSORT);
            foreach ($GLOBALS['hooks']->load('class.gui.javascripts') as $hook) include $hook;

            $GLOBALS['smarty']->assign('JS_SCRIPTS', str_replace(CC_DS,"/",$js));

This collects all the filenames in the skin's /js/ folder and gives them to Smarty to populate the template.

 

In the (CC600b5) file /classes/gui.class.php, near line 154, there is also:

            // <body> JS
            foreach ($GLOBALS['hooks']->load('class.gui.body_js') as $hook) include $hook;
            if (isset($body_js) && !empty($body_js) && is_array($body_js)) {
                $GLOBALS['smarty']->assign('BODY_JS', $body_js);
            }

I still haven't traced out out exactly how filenames end up in BODY_JS as CC5216 doesn't have the code to put anything in there, but that's what your Foundation skin is doing.

 

Also, try this: download Beta5 and use the Foundation skin from it. I think you are using a Foundation skin from an earlier beta.

Link to comment
Share on other sites

Nope, all of the above is not quite right.

 

I think you do have the Beta5 Foundation skin, and there is some confusion here, although I don't know why for some browsers it does not exhibit this problem.

 

Anyway, in the template main.php, remove these lines because they are hard-coded in the template, but the GUI class loads them in again.:

            <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/foundation.min.js"></script>
and
            <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/cubecart.js"></script>
            <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/cubecart.validate.js"></script>
Link to comment
Share on other sites

As for the second problem, I am using the Beta1 Foundation and there is not yet appearing a lot of new HTML5 stuff. For example:

Beta1 (and CC5):
<span class="old_price">{$PRODUCT.price}</span> <span class="sale_price">{$PRODUCT.sale_price}</span>
 
Beta5:
<span class="old_price" id="fbp" data-price="{$PRODUCT.full_base_price}">{$PRODUCT.price}</span>
<span class="sale_price" id="ptp" data-price="{$PRODUCT.price_to_pay}">{$PRODUCT.sale_price}</span>

I don't know if there is javascript or something else that may be affecting what the browser displays based on the "data-price" attribute.
 

Link to comment
Share on other sites

Hi bsmither,

 

I've removed the lines of code you stated above and this worked however now I can only have one of each item in the basket. If i select more than one of an item it defaults to 1 and if you go to checkout and try to revise the cart it doesnt move from one item.

 

As for the sale price, are you saying you cant see what is causing the problem?

 

Matt


And now i've put those lines of code back in and it still only allowing 1 of any item in the basket no matter what you select.

Link to comment
Share on other sites

Ok, so i have fiddled around a bit more and worked out that i can add multiple items to the basket by clicking add to basket multiple times, but i cannot change the figure in the quantity box, if you type 3 in it only adds one, then if you to the items in your basket and try and modify the quantities of any product in your basket it remains at whatever you have added one at a time.

 

And now, when you hover over a category the drop down menu only appears for a split second and doesnt stay there long enough for you to select something.

Link to comment
Share on other sites

Ok, so i have fiddled around a bit more and worked out that i can add multiple items to the basket by clicking add to basket multiple times, but i cannot change the figure in the quantity box, if you type 3 in it only adds one, then if you to the items in your basket and try and modify the quantities of any product in your basket it remains at whatever you have added one at a time.

This works fine for me on your store - changed quantity to 2 for one product and it correctly added two to the basket. The only time it didnt work is when I tried to add 3 of one product and it showed a warning message that you didnt have that many in stock and so had reduced the quantity to 1

And now, when you hover over a category the drop down menu only appears for a split second and doesnt stay there long enough for you to select something.

The problem you have is that the sub category menu is not auto expanding as it should in Foundation and so I need to click on the top level category in order to show sub level categories but that click actually takes you to that category.

You also have a problem where the Search Engine Friendly urls are not showing

I would guess that you have made changes to the core CubeCart files and / or the skin files and this has caused these problems

Ian

Link to comment
Share on other sites

We are running CC 5.2.16 with the Foundation Skin, and we are "fully informed" of the unknowability and unpredictability.

 

@Havenswift, Can you confirm by observation that, as described in post #11 the javascript loads into your installation of whatever CubeCart that is running Foundation?

Link to comment
Share on other sites

Havenswift,

 

I havent changed any code whatsoever, all i have done is install the software as a new installation, customise the pages in control panel, add a logo and add a few products.


bsmither,

 

I thought it was CC6 that was in its infancy and was unpredictable being that is was in beta format, i tried installing 6 however had issues and was told 5 would be a better option.

 

Why is it only the foundation skin that is having the issues and is there likely to be any patches any time soon?

Link to comment
Share on other sites

 

I thought it was CC6 that was in its infancy and was unpredictable being that is was in beta format, i tried installing 6 however had issues and was told 5 would be a better option.

 

Why is it only the foundation skin that is having the issues and is there likely to be any patches any time soon?

The foundation skin was designed to work with V6 and while it might be made to work with V5, it isnt advisible unless there are very specific good reasons to do so. If you are starting a new store then why not start with V6 and get all the extra functionality features that are included. Yes it is still beta but probably only for another week or so

Ian

Link to comment
Share on other sites

I have just tried the shopping cart i firefox, chrome and IE and i cannot adjust the quantities of the items in either the store or in the cart, but as stated in a previous post i can add singular items repeatedly to get the quantity i want, but if i go one to many items i need to remove the item completely from the basket and re-add them.

 

All items are also listed as on sale in all three browsers.


 

 
I thought it was CC6 that was in its infancy and was unpredictable being that is was in beta format, i tried installing 6 however had issues and was told 5 would be a better option.
 
Why is it only the foundation skin that is having the issues and is there likely to be any patches any time soon?


The foundation skin was designed to work with V6 and while it might be made to work with V5, it isnt advisible unless there are very specific good reasons to do so. If you are starting a new store then why not start with V6 and get all the extra functionality features that are included. Yes it is still beta but probably only for another week or so

Ian

 

Hi Ian, i might just update to six then. I'll track the instructions down and give that a go tomorrow and see if it fixes the issues. I dont really like any of the other skins so i would prefer to find out a way to keep using Foundatio if I can.

Link to comment
Share on other sites

@bsmither,

 

im more than happy to help sort it, i dont know if anyone is having similar issues. I have had issues with windows 8 doing strange things to sites. For example in windows explorer and chrome i cannot copy and past text into the description field when adding products. However when i use firefox i can do it no problem.

 

Once V6 is no longer in beta format i will upgrade to that, but in the mean time im happy to do whatever is needed to try and solve this problem. I certainly agree it is inconsistent.

Link to comment
Share on other sites

The copy/paste problem has been explored and the smoke (from the 'smoking gun') is coming from the browser's security setting that prohibits javascript from accessing the browser's (actually, probably the operating system's) "clipboard". An internet search on windows clipboard security has a number of hits.

 

I haven't tried this, so....

 

The rich text editor has a "Copy" toolbar button. Open a browser window and have it show the Description editor of the source item. Open a second browser window (or maybe a second tab will work better, try both ways) and have it show the Description editor of the current item.

 

Select the text in the source editor, click the editor's Copy button, then over at the current editor, click on the editor's Paste button.

 

I would say to not use the CTRL-C or any other keyboard shortcut that puts the selection on the operating system's clipboard. However, the editor's documentation (CKEditor) says to use CTRL-C and CTRL-V to make the copy/paste. And there is nothing being returned from a search for 'clipboard' in the CKEditor's forum about this.

Link to comment
Share on other sites

Hi bsmither,

 

I tried a heap of things to get it to work, the least complicated of them all was just to use firefox when i wanted to cut and paste stuff, it works as normal with no hassle.

 

The next thing is do i upgrade to 6, which i will have to do eventually anyway or stick with 5 and make the two issues at hand work properly?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...