VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Questions VM 1.1 ( the only active board for the old version) => Topic started by: naveed_khan on January 28, 2009, 12:51:53 pm

Title: Add to cart functionality is not working properly in VM 1.1.3
Post by: naveed_khan on January 28, 2009, 12:51:53 pm
I just installed VM 1.1.3 on joomla 1.0.15, 1.0.8 and joomla 1.5.7. On the front side the Add to cart functionality does not work properly.

The problem occurs after adding a product into cart and clicking the continue button in Ajax prompt window, when you again add the same product that Ajax window does not prompt again. Although the product still adds in the cart but the window does not display again until you refresh the page.

The firebug displays the following error:
timeoutID is not defined.

Any solution of suggestion for solving this problem.
Thanks in advance.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: mmarfy on January 29, 2009, 23:57:57 pm
take the following file from virtuemart 1.1.2:
/components/com_virtuemart/themes/default/theme.js
and replace on your virtuemart 1.1.3, this will solve the problem, until someone that knows javascript puts hands on the problem
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: naveed_khan on January 30, 2009, 08:44:37 am
Thanks a lot mmarfy. This solution works for me. i have tested it on both joomla 1.5.7 and 1.0.15 the cart popup is working now.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: mmarfy on January 30, 2009, 10:21:56 am
yes it works, but from what I have understood examining the file there was added a good function to close automatically the ajax popup whith a timeout, even in multiple opening, there's a bug just on this, I don't know javascript, but it looks like a missing variable declaration, the timeoutID. it is beautiful if VM team fix this
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: naveed_khan on January 30, 2009, 13:04:12 pm
The problem is causing because the code is trying to close the prompt box if it is open and clear the timeout value.

HERE is that code:

line 33 to 36
// close an existing mooPrompt box first, before attempting to create a new one (thanks wellsie!)

if (document.boxB) {
document.boxB.close();
clearTimeout(timeoutID);
}

The code should also work after removing or commenting the above lines.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: mmarfy on January 30, 2009, 15:42:44 pm
remove only timeoutID and leave the code so:
clearTimeout();
this should fix the bug
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: monteiz on April 08, 2009, 22:32:57 pm
It does not fix the bug, it just prevents the error to show.

Do that instead:



var vm_timeoutID = 0;

function handleAddToCart( formId, parameters ) {
   formCartAdd = document.getElementById( formId );
   
   var callback = function(responseText) {
      updateMiniCarts();
      // close an existing mooPrompt box first, before attempting to create a new one (thanks wellsie!)
      if (document.boxB) {
         document.boxB.close();
         clearTimeout(vm_timeoutID);
      }

      document.boxB = new MooPrompt(notice_lbl, responseText, {
            buttons: 2,
            width:400,
            height:150,
            overlay: false,
            button1: ok_lbl,
            button2: cart_title,
            onButton2:    handleGoToCart
         });
         
      vm_timeoutID = setTimeout( 'document.boxB.close()', 3000 );
   }



monteiz

Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: macallf on April 09, 2009, 02:03:10 am
This is fixed in VM 1.1.4 also the problem of the lightbox not initialising after AJAX page load.

VM1.1.4 should be out soon, but don't press me for a date as I don't know.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 22, 2009, 17:22:11 pm
OK - I made monteiz's changes, and, yes, the Ajax popup now stays longer BUT if you stay at the same product and try to add another item to the cart (another child, let's say), the popup doesn't work AND the additional purchase is NOT reflected in the mini cart until the page is either reloaded OR you go to the cart.

Is there a fix for this available now?  If not, I think that I'll just disable the Ajax cart.  I don't like customers having to keep going back and forth between the cart page and the products, but that Ajax popup and mini cart just don't function that well.

Also, there is the ongoing problem of the Ajax popup being too transpearant.  I looked at the FAQ posted on how to change the popup color, BUT that only changes the yellow text background, not the whole box.  For me, the box issue is that it is completely transparent, and therefor gets muddled up with the product page.

Is there a way to change the color and transparency of the popup box?


It does not fix the bug, it just prevents the error to show.

Do that instead:



var vm_timeoutID = 0;

function handleAddToCart( formId, parameters ) {
   formCartAdd = document.getElementById( formId );
   
   var callback = function(responseText) {
      updateMiniCarts();
      // close an existing mooPrompt box first, before attempting to create a new one (thanks wellsie!)
      if (document.boxB) {
         document.boxB.close();
         clearTimeout(vm_timeoutID);
      }

      document.boxB = new MooPrompt(notice_lbl, responseText, {
            buttons: 2,
            width:400,
            height:150,
            overlay: false,
            button1: ok_lbl,
            button2: cart_title,
            onButton2:    handleGoToCart
         });
         
      vm_timeoutID = setTimeout( 'document.boxB.close()', 3000 );
   }



monteiz


Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: macallf on April 22, 2009, 19:24:39 pm
The code you posted fixes the problem with the ajax popup box only working once!

I know, cause it works on my test site. http://photography.noctilucent.me.uk/index.php?page=shop.product_details&flypage=flypage-ask.tpl&product_id=6&category_id=1&option=com_virtuemart&Itemid=53 (http://photography.noctilucent.me.uk/index.php?page=shop.product_details&flypage=flypage-ask.tpl&product_id=6&category_id=1&option=com_virtuemart&Itemid=53)

the popup box is not transparent, unless you have changed the styling already

Style is set in mooprompt.css

which is in components/com_virtuemart/js/mootools
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 22, 2009, 19:44:25 pm
I haven't made any changes to the styling at all, except what I have posted here.  The popup has been transparent AND popped up behind the child boxes since the get-go.  Attached is a pic.  I would love to get this feature to work, but can't make it work so far. 

The code you posted fixes the problem with the ajax popup box only working once!

I know, cause it works on my test site. http://photography.noctilucent.me.uk/index.php?page=shop.product_details&flypage=flypage-ask.tpl&product_id=6&category_id=1&option=com_virtuemart&Itemid=53 (http://photography.noctilucent.me.uk/index.php?page=shop.product_details&flypage=flypage-ask.tpl&product_id=6&category_id=1&option=com_virtuemart&Itemid=53)

the popup box is not transparent, unless you have changed the styling already

Style is set in mooprompt.css

which is in components/com_virtuemart/js/mootools

[attachment cleanup by admin]
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: macallf on April 22, 2009, 20:03:52 pm
Your template has set the z-index of the main page to 1, should always be set to 0

Hence all the items in VM are appearing in front of the ajax cart popup.

the code that you posted does fix the ajax popup problem.

and changing mooprompt.css

.cbOverlay {
   background-color: #000;
z-index: 5;
}

.cbContainer {
   padding:5px;
   background-color:white;
   border: 2px solid gray;
z-index:5;
}

Should cure the popup being behind the elements.

As to the pop always being behind the elements, I guess if you were using the standard joomla template then the problem would not be there.

Hence, you have changed the styling, even if you did not realise it.

Unfortunately we cannot second guess template designers and unfortunately due to the nature of VM, sometimes you will have to make changes!
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 22, 2009, 20:17:21 pm
OOOH!  GOT IT!  Thanks SO very much for your help on this.  I'll see if I can make the changes and hopefully it will work!

So much to learn with all of this....
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 22, 2009, 21:39:41 pm
Wow!  That WORKED!  Now the only problem left for me is that any "add to cart" on the same page is NOT reflected in the cart until the page is refreshed.  I might be able to put that issue to bed as soon as I can get that fixed!

Thanks!
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: macallf on April 22, 2009, 22:05:58 pm
you may have to change the z-index of

.vmCartModule

in /components/com_virtuemart/themes/default/theme.css

It's probably at the wrong position because of all the z-index's present
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 23, 2009, 00:53:42 am
The popup window seems to be working OK now (except that the "add to cart" is not reflected in the minicart until the page is refreshed), but I went to the theme.css file anyway to take a look.  I didn't see any z-index there, and the only .vmCartModule I found was this:

.vmCartModuleList  {
  cursor : pointer;
  font-size        : 11px;
  color            : #000000;
  text-decoration  : none;
  font-weight      : bold;
}
.vmCartModuleList:hover {
  font-size        : 11px;
  color            : #333333;
  text-decoration  : none;
  font-weight      : bold;

I'm probably looking in the wrong file?  This is from the path that you specified above.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: macallf on April 23, 2009, 01:04:12 am
correct file just no def for it, just add

.vmCartModule {
      z-index: 5;
}

I think that maybe the problem, but can't be sure.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: macallf on April 24, 2009, 04:31:39 am
Nope that wasn't the problem.

After debugging the code, it suddenly clicked! You didn't have an index2.php file in the root of your joomla structure.

Index2 is used to display popups without the joomla template being displayed, just the content of the current component. The AJAX updater uses this to generate the html to refresh the cart module. It wasn't there so the info wasn't updated.

I have put the index2.php file in the root of your site and now everything works.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 24, 2009, 04:39:31 am
That is SO great.  Could you post the content of the index2.php file and tell people exactly where to put it?  I know that I am not the only person who is having this problem.

I just think that it is amazing that you developers can keep all of this straight and notice these errors.  Thanks SO much...I know that there are a bunch of us our there who are going to be thrilled with this fix.

Happy!  Happy!  Joy!  Joy!
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 24, 2009, 04:43:14 am
I just took a quick look at that file. Just a small snippet of code in one extra file, but obviously something that I was missing for some reason.

Tomorrow I'll put up a post showing exactly what you put in and where and I'll see if I can get that fix to the others that I have seen who have had the same problem.  Wow.  It's amazing that something that small could cause such a problem.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: macallf on April 24, 2009, 05:01:26 am
index2.php should be installed by Joomla by default. It is in the base package, I can only surmise that it was accidentally deleted.

It is also included in the ecommerce edition of VM.

I suppose some could think it is an edited file that can be deleted, obviously not!



Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: EquiProVM on April 24, 2009, 05:47:08 am
Yea, and I think that that someone was ME!  What else could have happened.

Well, whatever happened, since there are others who are having the same problem, and easy solution is for them to check to see if that file is there.  If it ISN'T, then it is a quick fix for the problem!
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: xpert on May 13, 2009, 12:14:55 pm
fixed it


function handleAddToCart( formId, parameters ) {
   formCartAdd = document.getElementById( formId );
   
   var callback = function(responseText) {
      updateMiniCarts();


      // close an existing mooPrompt box first, before attempting to create a new one (thanks wellsie!)
      if (document.boxB) {
         document.boxB.close();
         clearTimeout( 'document.boxB.close()', 2000 );
      }
      document.boxB = new MooPrompt(notice_lbl, responseText, {
            buttons: 2,
            width:400,
            height:150,
            overlay: false,
            button1: ok_lbl,
            button2: cart_title,
            onButton2:    handleGoToCart
         });
         
      setTimeout( 'document.boxB.close()', 3000 );
   }
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: ennsol on June 16, 2009, 23:28:35 pm
With that fix it is OK in IE7 but in FF with Firebug I get:

can't convert "document.boxB.close()" to an integer
[Break on this error] clearTimeout( 'document.boxB.close()', 2000 );

Regards
Mark
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: kidhunt on July 12, 2009, 12:17:08 pm
I get a problem with my virtuemart, i use version 1.1.3. When i click the addtocart button at first, it appear an ajax message box, but after that, when i click another addtocart button or the same that i have clicked before, the pop up does not show. How can I fix this problem? Please help me!

P.S: i also have the index2.php in my joomla :D
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: revive on July 22, 2009, 18:24:08 pm
macalif,
I've just run into an issue with the minicart.. would you be willing to  give me your thoughts on it??

I'm using VM 1.1.3 and Joomla 1.5.12 (both are the most current version).. when a user adds an item to the cart, the minicart loads the complete homepage in it !! If I refresh the page, then the minicart looks normal.. any ideas?
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: felixp on September 30, 2009, 20:15:58 pm
Where is the URL for the 'Cart' button in the popup set?
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: revive on October 01, 2009, 05:59:56 am
@felixp

You're better off checking into other ecommerce solutions at this point.. VM has been fairly unsupported from the dev team - even though we have created many custom stores with it, VM spec modules, etc.. we've found the lack of community and developer support, as well as the known, unfixed bigs.. simply to much of a burden on clients.. Sad to say, because we really dig VM.. but, until they refactor it into v2.0, it's a dying dog. And, you can see from the date of my last post here how responsive team members are to reply.

Ironically, @macalif, is apart of a new ecommerce spin off within Joomlacode... so, looks like he agrees that there is another route besides VM for ecommerce in Joomla..

Check out Foxycart, OpenCart or others...

Best of luck to you..
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: zvenson on November 04, 2009, 08:53:44 am
Quote
Now the only problem left for me is that any "add to cart" on the same page is NOT reflected in the cart until the page is refreshed.  I might be able to put that issue to bed as soon as I can get that fixed!

Thanks!

I have the same problem - but the index2.php is there in my shop. an easy solution for this coul be that the add to cart button directs automatically to the shopping cart and don't use this popup which i find not ideal by the way. Has anyone done something like this yet?

cheers and thanks!
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: zvenson on November 04, 2009, 14:38:54 pm
Code: [Select]
The only solution we have found to the bugs, issues and lack of mods/developers support here in the forum.. is to switch from Virtuemart to ANY OTHER ecommerce platform that will work.
oh boy :).

i think my problem can be solved somehow without switching to another ecommerce system - but it is true the support in this forum is quite bad - as none of my questions have been answered so far - but i'm trying to figure this one out somehow...
but vm is working good for me so far.

Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: zvenson on November 05, 2009, 04:02:09 am
the easy solution for my problem was to just disable the ajax feature for the addtocart function. Now it's working great.

go to -> admin -> config -> website -> under layout klick configuration -> disable "Use Ajax to add, update or delete products from the cart?"

this worked for me.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: aravot on November 05, 2009, 06:42:19 am
@revive and zvenson, just because your questions are not answered it doesn't mean there is no support, look around and you will see questions are answered.

You are welcome to use any solution that suites your needs.
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: zvenson on November 05, 2009, 10:11:42 am
@aravot
sure - was no offence - sorry for that - but if questions get a little more specific there is little to no support in all the forums that i have been to the last couple of month. So that's not something vm specific - i know that answering complex questions takes always time for the developer and there is no payment at all - so i have plenty of respect for everyone you shares knowledge and helps others.
So THUMBS UP for everybody who has helped to build vm as it is a great system and i very much like it!
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: adrian on June 02, 2010, 10:12:32 am
its working on IE still not working in mozilla will keep trying

I haven't made any changes to the styling at all, except what I have posted here.  The popup has been transparent AND popped up behind the child boxes since the get-go.  Attached is a pic.  I would love to get this feature to work, but can't make it work so far. 

The code you posted fixes the problem with the ajax popup box only working once!

I know, cause it works on my test site. http://photography.noctilucent.me.uk/index.php?page=shop.product_details&flypage=flypage-ask.tpl&product_id=6&category_id=1&option=com_virtuemart&Itemid=53 (http://photography.noctilucent.me.uk/index.php?page=shop.product_details&flypage=flypage-ask.tpl&product_id=6&category_id=1&option=com_virtuemart&Itemid=53)

the popup box is not transparent, unless you have changed the styling already

Style is set in mooprompt.css

which is in components/com_virtuemart/js/mootools
Title: Re: Add to cart functionality is not working properly in VM 1.1.3
Post by: dig814 on July 26, 2010, 16:33:59 pm
Any solution? Still trying to get multiple pop ups in all browsers.