X-Cart Mods, X-Cart Addons - WebsiteCM
 
X-Cart Excellence eZine
Subscribe for proven tips and special discounts!
   Forum Search
Forum Menu
Quick Links
Forum Login
Username:

Password

Remember Me
Forum Expert(s)
X-Cart Mods, X-Cart Addons - WebsiteCM
Developing websites since the early-to-mid 90's, and working extensively with e-commerce since 2001, Jon Peters of WebsiteCM is equipped to assist you with your design, programming, e-commerce, and x-cart specific questions.

Adding Pricing Modifiers

About this Thread:
You are viewing the thread Adding Pricing Modifiers in the eCommerce forum.

  #1  
Old January 10th, 2008, 02:44 AM
tap tap is offline
Junior Member
 
Join Date: Jan 2008
Posts: 14
Default Adding Pricing Modifiers

I need to add two items to the Wholesale Pricing values. Where there is currently "Quantity", "Price" and "Membership" I need to add "Purchase Type" and "Upgrade".

I know that I need to modify product_wholesale.php and product_wholesale.tpl to include the items.

I need these to be available for selection like the Membership values. I saw that these values are pulled from a separate table.

I thought I could added these in the foreach loop for Memberships as:

<td><select name="wprices[{$v.priceid}][type]">
<option value='Standard'{if $v.type eq 'Standard'} selected="selected"{/if}>Standard</option>
<option value='Educational'{if $v.type eq 'Educational'} selected="selected"{/if}>Educational</option>
<option value='Concurrent'{if $v.type eq 'Concurrent'} selected="selected"{/if}>Concurrent</option>
</select>
</td>

with something similar done for the Upgrades (which are a "Y" and "N" value in the pricing table.

I thought I had this working with one variation but have run into two issues:

1. I need to be able to specify multiple purchase types for the same quantity so I can define pricing for 10 users for a standard, educational, and concurrent license. Currently only one entry per quantity seems to be occurring.

2. When I updated "type" and "upgrade" for one product this somehow didn't write back to the database correctly and all product information disappeared. Although I can look at the product in the products table on the server, when I search for the product in the admin backend, no results are returned. It's as if the product doesn't exist anymore.

Please help.

By the way, do all the database queries in product_wholesale.php need to be modified to include these items, i.e. from:

db_query("DELETE FROM $sql_tbl[pricing] WHERE productid = '$productid' AND membershipid = '$old_data[membershipid]' AND quantity = '$old_data[quantity]' AND variantid = '0'");

to

db_query("DELETE FROM $sql_tbl[pricing] WHERE productid = '$productid' AND membershipid = '$old_data[membershipid]' AND quantity = '$old_data[quantity]' AND variantid = '0' AND type = '$type' AND upgrade = '$upgrade'");

or is it sufficient to reference these values here:

$query_data = array(
"productid" => $productid,
"quantity" => $newquantity,
"price" => abs($newprice),
"membershipid" => $membershipid,
"type" => $type,
"upgrade" => $upgrade
);

Thanks, Troy

Last edited by tap : January 10th, 2008 at 02:48 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old January 10th, 2008, 06:00 AM
tap tap is offline
Junior Member
 
Join Date: Jan 2008
Posts: 14
Default

I actually have both select boxes working as I need them to now (without modifying the db_query commands ! ).

My only problem is that I can only define a single set of values for each quantity. However, since I can define multiple product types, I need to be able to define separate pricing for each product type (and upgrade type as well).

I believe the reason I'm only seeing one listing of quantites is because of the "if" in the "foreach" loop:

{if $v.membershipid > 0 || $v.quantity > 1}

When I change this to this:

{if $v.membershipid > 0 || $v.quantity != ""}

I see all values listed, however if I try to edit the values for the quantity of "1" with the membership set to "Premium" I get an error that I don't have permissions to modify this, and then the product is no longer visible and can't be found through the product search.

What do I need to change so that I can specify multiple prices for the same quantity (with differences in "type" or "upgrade")?

Thanks, Troy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

Site Map