X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Popup - Item Added to Cart (https://forum.x-cart.com/showthread.php?t=46934)

idandt 04-29-2009 01:26 AM

Re: Popup - Item Added to Cart
 
Hi Great modification thanks for sharing it. Do you have an version for Version 4.2.0. I tried it but cant get the pop up to show. It adds to the basket fine though.

Many thanks

Learner 06-04-2009 09:43 PM

Re: Popup - Item Added to Cart
 
Hi,
autobulbs thanks for your codes.I have Special offer modules where I give some offers to the customer.Now when a customer enters into the shopping cart there are two buttons named Proceed to pay & check for special offers.But Unfortunately some of my customers forget to click check for special offers button and they will not get that offer products.
I want when a customer click into proceed to pay button then a small pop up will open and say"Please click check for special offers button to avail discounts/offers if any before you select "proceed to pay".

Is it possible to? Can you help me?

Thanks to all.

Warwick 06-07-2009 01:10 AM

Re: Popup - Item Added to Cart
 
Great mod! I'm also interested to find out if it works with 4.2.x

Learner 06-30-2009 03:01 AM

Re: Popup - Item Added to Cart
 
Quote:

Originally Posted by Learner
Hi,
autobulbs thanks for your codes.I have Special offer modules where I give some offers to the customer.Now when a customer enters into the shopping cart there are two buttons named Proceed to pay & check for special offers.But Unfortunately some of my customers forget to click check for special offers button and they will not get that offer products.
I want when a customer click into proceed to pay button then a small pop up will open and say"Please click check for special offers button to avail discounts/offers if any before you select "proceed to pay".

Is it possible to? Can you help me?

Thanks to all.


Hi,
autobulbs is it possible to do?

Thank you.

Learner 07-09-2009 03:27 AM

Re: Popup - Item Added to Cart
 
Quote:

Originally Posted by Learner
Hi,
autobulbs thanks for your codes.I have Special offer modules where I give some offers to the customer.Now when a customer enters into the shopping cart there are two buttons named Proceed to pay & check for special offers.But Unfortunately some of my customers forget to click check for special offers button and they will not get that offer products.
I want when a customer click into proceed to pay button then a small pop up will open and say"Please click check for special offers button to avail discounts/offers if any before you select "proceed to pay".

Is it possible to? Can you help me?

Thanks to all.


Hi,
autobulbs is it possible? Can you help me?

royng 07-16-2009 04:03 PM

Re: Popup - Item Added to Cart
 
Quote:

Originally Posted by Learner
Thanks autobulbs for your effort.
Also is it possible to insert a close button and the small red window scroll through the page?


It's not working for me(4.1.11)
I can't find the menu_cart.tpl in the root or skin folder

I can see it in skin1/menu_cart.tpl, so I added the code there.

Is that why it's not working?

Learner 07-24-2009 04:59 AM

Re: Popup - Item Added to Cart
 
Hi,
autobulbs thanks for your codes.I have Special offer modules where I give some offers to the customer.Now when a customer enters into the shopping cart there are two buttons named Proceed to pay & check for special offers.But Unfortunately some of my customers forget to click check for special offers button and they will not get that offer products.
I want when a customer click into proceed to pay button then a small pop up will open and say"Please click check for special offers button to avail discounts/offers if any before you select "proceed to pay".

Is it possible to? Can you help me?

Plucky Pear 08-12-2009 11:52 AM

Re: Popup - Item Added to Cart
 
Does this work on 4.2? I know people asked but I don't see an answer

autobulbs 08-13-2009 07:30 AM

Re: Popup - Item Added to Cart
 
I am currently rebuilding our main store on 4.2.2 so this module will be working on 4.2.2 in a few days.

I will post the code on Monday

autobulbs 08-17-2009 02:09 AM

Re: Popup - Item Added to Cart
 
4.2.2 Basket Popup Code

I think it's all here, and I've had to sift thru it to remove our theme specific junk. Read the comments within the CSS and TPL files

Go to Patch/Upgrade and then Apply SQL Patch and run this:

Code:

INSERT INTO `xcart_modules` (`module_name`,`module_descr`,`active`) VALUES
  ('Item_Added','This module popups when a customer adds something to the basket. Remember to set redirect customer to cart to N','N');



Create modules/Item_Added/item_added.php and put this in it:

PHP Code:

<?php
  
/* Item Added Popup */
  
x_session_register("item_added");
  
$smarty->assign("item_added","$item_added");
  
x_session_unregister("item_added");
  
/* /Item Added Popup */
  
?>



Open home.php and find this:

PHP Code:

# Assign the current location line
  
$smarty->assign("location"$location); 


Add this before it:

PHP Code:

# Item Added Module
  
if (!empty($active_modules["Item_Added"]))
              include 
$xcart_dir."/modules/Item_Added/item_added.php"



Open product.php and find this:

PHP Code:

# Assign the current location line
  
$smarty->assign("location"$location); 


Add this before it:

PHP Code:

# Item Added Module
  
if (!empty($active_modules["Item_Added"]))
              include 
$xcart_dir."/modules/Item_Added/item_added.php"


Open cart.php and find this ( around line 258 ):

PHP Code:

func_save_customer_cart($login$cart); 


Paste this below it:

PHP Code:

/* Item Added Popup */
                          
x_session_register("item_added");
                          
$item_added=1;
                          
/* /Item Added Popup */ 


Open skin1/customer/menu_cart.tpl and paste this after {capture name=menu}

Code:

{if $item_added eq 1}<div class="item_added" id="item_added_box"><div>{include file="customer/item_added.tpl"}</div></div>{/if}

Open main.css and add this code (edit to fit your theme):

Code:

/* The popup wrapper, brings the element to the front */
  .item_added {
  position:absolute;
  width:1px;
  height:1px;
  text-align:left;
  }
  /* The popup inner wrapper, positions the popup √ you can fine tune it here */
  .item_added > div {
  position:relative !important;
  display:block;
  top:24px;
  z-index:9999;
  left:-24px;
  }
  /* The main body of the popup change the bg color or use an image */
  #basketPopup {
              background:#e1e1e1;
              height:216px;
              width:210px;
              color:#484848;
              padding-left:54px;
  }
  #basketPopup div {
              color:#fff !important;
  }
  #basketPopup a {
              color:#fff !important;
              text-decoration:underline;     
  }
  /* The popup main title */
  #basketPopup .basketPopupTitle {
              font-weight:bold;
              font-size:13px;
              text-align:right;
              width:162px;
              padding:12px 0;
              float:left;
  }
  #basketPopup #basketClose {
              /* The bg image is commented here and replaced with an ▒X▓ √ feel free to replace with an image */
              /* background:url(images /btn_close.gif) no-repeat; */
              height:14px;
              width:14px;
              float:left;
              margin: 8px 0 0 16px;
              cursor:pointer;
  }
  /* Keep shopping / View Basket buttons */
  #basketPopup .basketPopupButtons {
              clear:left;
  }
  /* Use this for an arrow image which links the popup to the minicart √ you will need to make an image */
  #basketJoiner {
              width:232px;
              text-align:right;
              padding-right:32px;
              margin-bottom:-1px;
  }



Create skin1/customer/item_added.tpl and put this in it

Code:

{* Remember to create the joiner.jpg image to fit your theme!! *}
  <div id="basketJoiner"><img src="{$ImagesDir} /joiner.png" alt="" /></div>
 
  <div id="basketPopup">
 
      {* The title of the popup *}
      <div class="basketPopupTitle">Item Added To Basket</div>
 
      {* The close button √ Remove the X and replace with an image *}
      <div id="basketClose" onclick="javascript:item_added_close();">X</div>
     
      {* The buttons view basket and keep shopping buttons, make your images to fit your theme *}
      <div class="basketPopupButtons"><a href="/cart.php"><img src="{$ImagesDir}/BasketPopup/btn_basket.gif" alt="View Basket" /></a> <a href="javascript:item_added_close();"><img src="{$ImagesDir}/keepshopping.gif" alt="Keep Shopping" /></a></div>
  </div>



One more thing - Open skin1/common.js and add this:

Code:

/* When something is added to the cart... Close it.... */
function item_added_close() {
    document.getElementById('item_added_box').style.display="none";
}


When you are happy to set it live, go to modules within the admin section, check Item_Added and click update to enable it


All times are GMT -8. The time now is 01:00 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.