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

MAP Pricing Mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 01-08-2005, 08:25 AM
 
chilll33 chilll33 is offline
 

Senior Member
  
Join Date: Oct 2003
Location: Miami, FL
Posts: 100
 

Default

Quote:
Originally Posted by ETInteractive.com
your not using products.tpl

if you have multiple rows of products (you have 3 per row)

you need to customize "products_t.tpl"

the code would be basically the same at product.tpl to display the MAP.

Thanks, I am using the following code to call the extra field in product.tpl:

{if $extra_field[1].field_value ne "Y"}


I have not found a way to call this from the products_t.tpl.
any tips help.

Thanks.
__________________
Core version:
5.3.2.7

PHP:
5.6.29
MySQL server:
5.5.5-10.0.27-MariaDB-cll-lve  (InnoDB engine support enabled)
Web server:
Apache
Operating system:
Linux
XML parser:
found
GDLib:
found (0)
Translation driver:
Database
Curl version:
7.29.0
Reply With Quote
  #22  
Old 01-08-2005, 08:43 PM
 
chilll33 chilll33 is offline
 

Senior Member
  
Join Date: Oct 2003
Location: Miami, FL
Posts: 100
 

Default

Well took me a while but I finally got my MAP Price mod working in 4.0.9
__________________
Core version:
5.3.2.7

PHP:
5.6.29
MySQL server:
5.5.5-10.0.27-MariaDB-cll-lve  (InnoDB engine support enabled)
Web server:
Apache
Operating system:
Linux
XML parser:
found
GDLib:
found (0)
Translation driver:
Database
Curl version:
7.29.0
Reply With Quote
  #23  
Old 01-09-2005, 04:35 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

Want to post and share the final code changes here?
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #24  
Old 01-15-2005, 08:45 AM
 
chilll33 chilll33 is offline
 

Senior Member
  
Join Date: Oct 2003
Location: Miami, FL
Posts: 100
 

Default

This is what I have so far:

First apply

Save as modules/Extra_Fields/extra_fields_array.php
Code:
<?php if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); } $provider_condition = ($single_mode?"":" AND $sql_tbl[extra_fields].provider='$extra_fields_provider' "); if($products) { foreach($products as $product) { $productid = $product['productid']; $extra_fields[$productid] = func_query("SELECT $sql_tbl[extra_fields].*, $sql_tbl[extra_field_values].value as field_value, IF($sql_tbl[extra_field_values].fieldid > 0, 'Y', '') as is_value FROM $sql_tbl[extra_fields] LEFT JOIN $sql_tbl[extra_field_values] ON $sql_tbl[extra_fields].fieldid = $sql_tbl[extra_field_values].fieldid AND $sql_tbl[extra_field_values].productid = '$productid' WHERE 1 $provider_condition ORDER BY $sql_tbl[extra_fields].fieldid"); } } $smarty->assign("extra_fields",$extra_fields); ?>

Patch products.php
Quote:
Code:
--- /hsphere/local/home/wwwuser/tch405gold/products.php 2004-09-29 23:23:34.000000000 -0700 +++ products.php 2004-10-20 18:43:11.000000000 -0700 @@ -82,6 +82,13 @@ include $xcart_dir."/modules/Subscriptions/subscription.php"; } +#RJS:extra_fields start +if(!empty($active_modules["Extra_Fields"])) { + $extra_fields_provider=$product_info["provider"]; + include $xcart_dir."/modules/Extra_Fields/extra_fields_array.php"; +} +#RJS:extra_fields end + $smarty->assign("products",$products); $smarty->assign("navigation_script","home.php?cat=$cat&sort=$sort&sort_direction=$sort_direction"); ?>

as in http://forum.x-cart.com/viewtopic.php?t=13217&postdays=0&postorder=asc&hig hlight=map%20price&start=15

then
in customer/main/
product.tpl

Code:
{if $active_modules.Subscriptions ne "" and $subscription} {include file="modules/Subscriptions/subscription_info.tpl"} {else} {if $extra_fields[4].field_value ne "Y"} <TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_list_price}:</TD> <TD valign="top"> {else} <TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_map}:<a onclick="newwindow=window.open('http://www.wiredparadise.com/mapprice.htm','Foretrex101','width=320,height=230')" href="#"> <font color="#0000FF" size="1">What is this?</font></a></TD> <TD valign="top"> {include file="currency.tpl" value=$product.list_price}</TD> </TR> {/if} <TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</TD> <TD valign="top"> {if $extra_fields[4].field_value ne "Y"} <FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$product.taxed_price}</SPAN></FONT><FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</SPAN></FONT> {if $product.taxes} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes}{/if} {else} <font color="#FF0000">{$lng.lbl_map_price}</font> {/if} </TD> </TR> {/if} </TABLE>

and products_t.tpl

Code:
{$lng.lbl_see_details} {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {assign var="pid" value=$products[product].productid} {if $products[product].taxed_price ne 0} {if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price} {math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%d" assign=discount} {if $discount gt 0} {if $extra_fields[$pid][4].field_value ne "Y"} <FONT class="MarketPrice">{$lng.lbl_market_price}: <S> {include file="currency.tpl" value=$products[product].list_price}</S> {else} <FONT class="MarketPrice">{$lng.lbl_map}: {include file="currency.tpl" value=$products[product].list_price} </FONT> {/if} {/if} {/if} {if $extra_fields[$pid][4].field_value ne "Y"} <FONT class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</FONT> <FONT class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</FONT>{if $discount gt 0}, save {$discount}%{/if} {if $products[product].taxes} {include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if} {else} <FONT class="ProductPrice">{$lng.lbl_our_price}: <font color="#FF0000">{$lng.lbl_map_price}</font> {/if} {/if} {/if} {if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0} {include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid} {/if} {if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"} {include file="customer/main/buy_now.tpl" product=$products[product]} {/if} </TD>


preview http://wiredparadise.com/shop/home.php?cat=719

only problem I cannot figure out yet is why this is not working in featured products in the home page, or the search box.

If any one has a solution please let me know.
__________________
Core version:
5.3.2.7

PHP:
5.6.29
MySQL server:
5.5.5-10.0.27-MariaDB-cll-lve  (InnoDB engine support enabled)
Web server:
Apache
Operating system:
Linux
XML parser:
found
GDLib:
found (0)
Translation driver:
Database
Curl version:
7.29.0
Reply With Quote
  #25  
Old 01-02-2007, 08:00 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 481
 

Default Re: MAP Pricing Mod

you have another link for an example? one you posted is a gone
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 03:25 PM.

   

 
X-Cart forums © 2001-2020