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

Price Update/Import by membership level mode

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 11-15-2003, 05:44 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Works like a dream, here is the code I had to make a couple more changes.

Updates based on ProductID.
CSV file columns are ProductID, Price, Quantity.

Working in V 3.4.9

Code:
<? /*****************************************************************************\ +-----------------------------------------------------------------------------+ | X-Cart | | Copyright (c) 2001-2003 Ruslan R. Fazliev <rrf@rrf.ru> | | All rights reserved. | +-----------------------------------------------------------------------------+ | PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" | | FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE | | AT THE FOLLOWING URL: http://www.x-cart.com/license.php | | | | THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE | | THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. | | FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING | | AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). | | PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT | | CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, | | COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY | | (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS | | LICENSE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THIS | | AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND | | OTHER INTELLECTUAL PROPERTY RIGHTS PROTECT THE SOFTWARE. THIS | | AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE | | THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.| | THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2003 | | Ruslan R. Fazliev. All Rights Reserved. | +-----------------------------------------------------------------------------+ \*****************************************************************************/ # # $Id: price_update.php,v 1 2003/09/10 ant Exp $ # @set_time_limit(1800); require "../smarty.php"; require "../config.php"; require "./auth.php"; require "../include/security.php"; if ($REQUEST_METHOD=="POST") { $provider_condition=($single_mode?"":" AND $sql_tbl[products].provider='$login'"); if($fp = @fopen($userfile,"r")) { while ($columns = fgetcsv ($fp, 65536, $delimiter)) { if ($columns[0]) { if ($what == "p") { $pid = func_query_first ("SELECT * FROM $sql_tbl[products] WHERE productid='$columns[0]' $provider_condition"); $f = "SELECT count(*) FROM $sql_tbl[pricing] WHERE productid='$columns[0]' AND membership='$membership' AND quantity='$columns[2]'"; echo $f." "; $tmp = array_pop(func_query_first($f)); # $tmp = db_query ($f); echo $tmp." "; if ($tmp != 0) { $f = "UPDATE $sql_tbl[pricing] SET price='$columns[1]' WHERE productid='$columns[0]' AND membership='$membership' AND quantity='$columns[2]'"; echo $f." "; db_query ($f); } else { $f = "INSERT $sql_tbl[pricing] VALUES ('','$columns[0]','$columns[2]','$columns[1]','$membership')"; echo $f." "; db_query ($f); } } } } $smarty->assign("main", "price_updated"); } else { $smarty->assign("main", "error_inv_update"); } } else { $smarty->assign ("main", "price_update"); } require "../include/categories.php"; @include "../modules/gold_display.php"; $smarty->display("provider/home.tpl"); ?>

Thanks again Anton. Super MOD.
Reply With Quote
  #12  
Old 11-15-2003, 05:51 PM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default

Glad you like it. I'm using the same concept for importing almost anything in the store.
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #13  
Old 04-12-2004, 05:03 AM
 
bswede bswede is offline
 

Member
  
Join Date: Mar 2004
Location: USA, Richardson Texas
Posts: 23
 

Default Great Mod!

Hi Guys:

Anton, is this the mod I think it is? Can I import a pricing model that allows for discount pricing based on quantity ordered rather than price with this mod? I think this is what I am reading. Please let me know if I am correct.

Thanks in advance.

Brad
__________________
Brad Hanson
Founder & CEO
Hanson Learning Technologies
Reply With Quote
  #14  
Old 04-12-2004, 05:35 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

This mod will let you import pricing based on quantity and membership level.

This is not a percentage based discount. You can apply % based discounts by membership level and they will be global for all products with DISCOUNT AVAIL checked.

The pricing format in this mod will let different membership levels have different ABSOLUTE pricing based on quantity.

IE.

Regular Customer Product Price = $1.00 @ Qty 1+
Wholesale Customer Product Price = $0.50 @ QTY 1-9
Wholesale Customer Product Price = $0.45 @ QTY 10-99
Wholesale Customer Product Price = $0.40 @ QTY 100+

Once logged in, a customer will see pricing in the dynamic store based on their membership level. If no membership level pricing has been defined then the base rate pricing will apply to all levels.

Enable the wholesale pricing module in your admin and play around with this in the product modification page.

Please remember that if you are using the html catalog, your customers will not see THEIR pricing until they login. Once logged in they will be operating in the PHP store and pricing will be dynamic.

I hope this helps. It's really pretty basic once you start using it. Oh, and Anton rocks for this super mod. It's da BOMB!
Reply With Quote
  #15  
Old 04-12-2004, 05:58 AM
 
bswede bswede is offline
 

Member
  
Join Date: Mar 2004
Location: USA, Richardson Texas
Posts: 23
 

Default

Thanks.

I will apply it today and let you folks know how it goes. This group really helps a bunch and I am greatful for all of the advise and suggestions.

Brad
__________________
Brad Hanson
Founder & CEO
Hanson Learning Technologies
Reply With Quote
  #16  
Old 04-12-2004, 07:30 AM
 
bswede bswede is offline
 

Member
  
Join Date: Mar 2004
Location: USA, Richardson Texas
Posts: 23
 

Default Mod Question

Hi Guys:

Will this mod work on 3.5.6? I have applied the code as noted and the import screen does not apprear. Being new to this product, I am not sure how this mod interacts or works with this version of code. Can you advise?

Brad
__________________
Brad Hanson
Founder & CEO
Hanson Learning Technologies
Reply With Quote
  #17  
Old 04-12-2004, 09:05 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

See if this helps.

You may have to modify the PHP file.

http://forum.x-cart.com/viewtopic.php?t=7366
Reply With Quote
  #18  
Old 04-12-2004, 11:37 AM
 
bswede bswede is offline
 

Member
  
Join Date: Mar 2004
Location: USA, Richardson Texas
Posts: 23
 

Default Hi Again

Hi Again:

I am now getting a message that reads:

Page not found!
The requested page is not exists or you are not allowed to access that resource!

I have looked around to see if there are any other missing include statements, but I do not see any.

Any suggestions?

Brad
__________________
Brad Hanson
Founder & CEO
Hanson Learning Technologies
Reply With Quote
  #19  
Old 04-13-2004, 08:02 AM
 
chatfield chatfield is offline
 

Advanced Member
  
Join Date: Aug 2003
Location: Amarillo TX USA
Posts: 38
 

Default

All I can say is WOW. I go away for three months and when I come back, the topic I'm looking for is right on the front page. Great mod Anton, thanks a heap.
__________________
X-Cart Gold 3.4.5 on Linux
Modified for B2B Wholesale only
(almost live)
Reply With Quote
  #20  
Old 04-13-2004, 07:33 PM
 
bswede bswede is offline
 

Member
  
Join Date: Mar 2004
Location: USA, Richardson Texas
Posts: 23
 

Default Fixed my Issue

Hi All:

For those of you who are on 3.5.6 and want to use this mod, I found out why my mod did not work. The code that is placed in the skin1/single/home.tpl also needs to be placed in the /provider/home.tpl. Also, be aware of the syntax changes for the php code. Read this entire thread and you will be directed to the information you need.

One last item. If you are still having issues, you can look at the inv_update.php file and base the synatx on that file.

Hope this helps.

Brad
__________________
Brad Hanson
Founder & CEO
Hanson Learning Technologies
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 07:41 AM.

   

 
X-Cart forums © 2001-2020