Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Show qualified special offers (outside of the cart)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-27-2012, 02:57 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Show qualified special offers (outside of the cart)

Hi,

I'm wondering if there's a way to use the Special Offers module to show only offers that the visitor is currently qualified for. This is possible on the cart, but I am hoping to achieve this outside of the cart and unfortunately the data seems inaccessible.

Any ideas?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #2  
Old 02-28-2012, 01:26 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Show qualified special offers (outside of the cart)

You probably have to grab the same code the cart uses to determine if it qualifies and use that.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #3  
Old 02-29-2012, 09:20 AM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: Show qualified special offers (outside of the cart)

Yes, unfortunately it doesn't seem to be available outside of the cart though - do you know what I mean?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #4  
Old 02-29-2012, 09:25 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Show qualified special offers (outside of the cart)

The data is in the database. You need a php page that establishes a connection to the database and the code snippet that gets the data you are looking for. I would use the X-Cart auth and functions to help you connect and get the data. You could use something like home.php as an example.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #5  
Old 02-29-2012, 09:25 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Show qualified special offers (outside of the cart)

You will have to find the code that calls special offers in cart.php and have same call on the page you want it to show so the offers array can be populated and pass to smarty
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #6  
Old 02-29-2012, 05:05 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: Show qualified special offers (outside of the cart)

Thanks Steve. There's a link shown on offers.php that says 'Show offers for cart'

The content on that link (offers.php?mode=cart&offers_return_url=) is what I want to embed into the main page but I can't locate where that code is being generated in offers.php or customers_offers.php. Any chance I can get some advice on where that page is being put together? I think with that info I can figure out how to pull the code I need.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #7  
Old 02-29-2012, 07:51 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Show qualified special offers (outside of the cart)

Look in offers.php - it calls '/modules/Special_Offers/customer_offers.php' to build the list and show the template
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #8  
Old 02-29-2012, 08:32 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: Show qualified special offers (outside of the cart)

I think I'm getting somewhere. The code below is from cart_offers.tpl - including this file on content.tpl doesn't display anything on the home page, but it's still active when the cart is loaded and it outputs the current active special:

{if $products and $cart.have_offers and $cart.applied_offers}

{capture name=dialog}

{foreach name=offers from=$cart.applied_offers item=offer}

{if $offer.promo_checkout ne ""}
<div>
{if $offer.html_checkout}
{$offer.promo_checkout}
{else}
<tt>{$offer.promo_checkout|escape}</tt>
{/if}
</div>

{if not $smarty.foreach.offers.last}
<div><img src="{$ImagesDir}/spacer.gif" width="1" height="30" alt="" /></div>
{/if}
{/if}

{/foreach}

{/capture}
{include file="customer/dialog.tpl" title=$lng.lbl_sp_offers_applied_to_cart content=$smarty.capture.dialog}

{/if}

The part I don't know how to do is to get the system to recognize $cart on the non-cart pages of the site. Any ideas???
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #9  
Old 02-29-2012, 11:11 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Show qualified special offers (outside of the cart)

See my previous post. The template receives from php and passes to html - just including the template doesn't mean it will show the info - that info has to be build first and come from somewhere and that is the php script
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #10  
Old 03-01-2012, 06:22 AM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: Show qualified special offers (outside of the cart)

I've found that in modules/Special_Offers/init.php the cart variable seems to be 'registered':

x_session_register('offer_products_priority');
x_session_register('cart');

and so I included tried loading the init.php on home.php and then called cart_offers.tpl to load on content.tpl (even tried removing the if statement) but still no luck. I'm afraid this one seems above my head.

Has anyone out there been able to achieve this?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:52 AM.

   

 
X-Cart forums © 2001-2020