Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bootstrap Modal Cart with Upsell Product


tgely

Recommended Posts

here's the index (before buy), shopping_cart (after clicking buy)

 

attachicon.gifindex.html

 

attachicon.gifshoping_cart.htm

 

hope this helps

There is nowhere "upCart". Did you installed it?

 

 

Modules->Content->Install Module->Modal Cart->Install Module

Set Display Cart After Adding Product->True

Enable Modal Cart

Edited by Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@Gergely,

This is strange.

I checked and the module is installed.

So, I uninstalled, copied the files across to my server again, and installed again.

Still no modal cart, and no upCart in the html.

so, what is the conflict?

I'm running php 5.4.31 on my XAMPP test server,

I'll keep investigating

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

do you have origin shopping_cart class?

Modal cart use sesion registered 'new_products_id_in_cart' value.

 

something like this should be there:
 

          if ($notify == true) {
            $new_products_id_in_cart = $products_id;
            tep_session_register('new_products_id_in_cart');
          }

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@Gergely,

yep, I have shopping_cart.php with class shoppingCart;

 

the code you quote sits within the following if statement

 

              if (($check_product !== false) && ($check_product['products_status'] == '1')) {

 

So, is the session not registering 'new_products_id_in_cart', or not being set correctly?

 

This is out of knowledge now!

 

Mike

 

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

@@Gergely

if I change, (in file cm_footer_modal_cart.php)

 

               if (tep_session_is_registered('new_products_id_in_cart') && DISPLAY_CART == 'false') {

to

 

 

                if (DISPLAY_CART == 'false') {

 

then the module works !!!

 

But the modal cart will keep popping up when you click checkout, so is new_products_id_in_cart not registered?

Mike

Edited by Mikepo

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

try to use $_SESSION['new_products_id_in_cart'] instead but I dont know your codebase.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

post here your shopping cart class

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@Mikepo nothing strange is found in cart class, but your php version could be a mistake. I think that session management could be responsible for bad work.

change in module:

 

if (tep_session_is_registered('new_products_id_in_cart')  && (int)$_SESSION['new_products_id_in_cart'] > 0 && DISPLAY_CART == 'false') {

Edited by Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@Gergely,

tried various conditions for the if statement, and on the odd occaision the modal cart popped up, then would not!

 

I'm running on my test server, an old windows PC, I'll have to test this on the unix shop server. looks like a session issue.

 

I will let you know.

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

  • 5 months later...

Hi @ll !

 

Gergely helped me got this to work... 

 

If you plan to use the modal cart popup together with the shopping card box (of if you simple wonder, why this is not working after installing it)

you have to prevent that the session variable 'new_products_id_in_card' becomes unregistered by the shoppingcard box bm_shopping_card.

 

This is easy to do  o:)  with the following code in catalog/includes/modules/boxes/bm_shopping_cart.php

          if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
			  if (!defined('MODULE_CONTENT_FOOTER_MODAL_CART_STATUS') || (defined('MODULE_CONTENT_FOOTER_MODAL_CART_STATUS') && MODULE_CONTENT_FOOTER_MODAL_CART_STATUS == 'False' )) {
				tep_session_unregister('new_products_id_in_cart');
			  }
          }

The outer IF-Query is already in the shopping_cart.php. Find it around line 60...

 

By the Way, there is a missing </div> in the template file of the modal cart... Add </div> in line 12 just before <div class="modal-footer"> and everthing is fine  :D

 

Thank you Gergely for the Help and the Module  :thumbsup:

 

SEE YA

Denzel.

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...

Hello @@Gergely,

 

Thank you for this addon, it's very usefull but the pop-up doesn't shows for me...

 

If I set "Display Cart After Adding Product" to true I can see the module in the footer of my shopping cart page. But if I set it to false, nothing happens, no pop-up.

 

Any idea why ? I have the new EDGE version but I already changed the "FILENAME_xxx" to the file names.

Link to comment
Share on other sites

Correction : I had the module displaying in the footer because I had a wrong code in my footer.php (I previously tried to install the shopping cart tooltip contribution and forget to remove the code in footer.php).

 

So now nothing displays, whether in a pop-up or in the footer. I tried to install the module in a clean version and it's the same, nothing shows. It seems that the problem occures with the new EDGE version ?

Edited by aurelou
Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

I have the latest edge and modal cart don't work as loke Aurélie (ma compatriote).

 

In the install.html, I see :

[your catalog]\includes\languages\english\modules\content\footer\cm_footer_modal_cart.php

[your catalog]\includes\modules\content\header\cm_footer_modal_cart.php  <============ curious

[your catalog]\includes\modules\content\header\templates\modal_cart.php    <============ curious

Why \header\ and don't \footer\ as the upload dir ?

 

Another thing : in the video and the capture screen, you said that Set Display Cart After Adding Product->False, but the instruction is Set Display Cart After Adding Product->True

with OsC 2.2 since 2006 ...

Link to comment
Share on other sites

In fact, after trying and trying, the upload dir est the right solution.

The <div id="upCart" class="modal fade"> ... </div><!-- /.modal --> is in the footer (generated html) but not the $script = <<<EOL
<script type="text/javascript">
  $(window).load(function(){
      $('#upCart').modal('show');
  });
</script>
EOL;

It seems that the addBlock don't work.

I try to modify $oscTemplate->addBlock($script, 'footer_scripts'); in $oscTemplate->addBlock($script_test, $this->group); because the $group is "footer" and not "footer_scripts" but nothing.

Any idea ?

with OsC 2.2 since 2006 ...

Link to comment
Share on other sites

Hello Gergely @@Gergely and other users,

 

I updated to jquery 3.1.0 and found that the following is deprecated since jquery 1.8 and has been removed in 3.0:

  $(window).load(function(){

it must be replaced by:

  $(window).on('load', function (){

so the javascript function in: includes/modules/content/footer/cm_footer_modal_cart.php

should be updated to:

$script = <<<EOL
<script type="text/javascript">
  $(window).on('load', function (){
      $('#upCart').modal('show');
  });
</script>
EOL;

rgds

Rainer

 

 

PS: just found that the link to the add-on in the instructions should be corrected, it opens the store search add-on:

http://addons.oscommerce.com/info/9328

Edited by raiwa
Link to comment
Share on other sites

Link to comment
Share on other sites

Thanks the report @@raiwa

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Hi again,

 

Is it possible to show only the last article which has been added to the cart ?

 

Oui, heu ... Yes Aurélie :)

In includes/modules/content/footer/cm_footer_modal_cart.php, in the function execute :

Find :

          for ($i=0, $n=sizeof($products); $i<$n; $i++) {

Replace by :

 

// for ($i=0, $n=sizeof($products); $i<$n; $i++) {

$i = count($products)-1;

 

and find :

 

            $cart_contents_string .= '<td style="text-align: right; padding: 1px;" width="20%">'  . $currencies->format($popup_price) . '</td></tr>';

          }

 

Replace by :

 

            $cart_contents_string .= '<td style="text-align: right; padding: 1px;" width="20%">'  . $currencies->format($popup_price) . '</td></tr>';

//          }

 

Edited by bonbec

with OsC 2.2 since 2006 ...

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...