OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Mod in progress- grid attributes
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Contribution Development
aspiringdeveloper
I hate to double post but in the installation & configuration forum I am not getting much help. this topic http://forums.oscommerce.com/index.php?showtopic=298652 is more of a core development issue. If a seaoned php developer can please read the thread (only 8 posts) it would really help me out.

Basically my proposed mod adds a few new tables. : grid_attibutes, grid_row_col.

Some products will have grid atributes which basically mean an an entry in the grid_attibutes table for each row/col cell in the table. The table will have prices shown.

To illustrate: I sell pet food in various flavours and various bag sizes. Its foolish to set up an individual attribute for each flavour-size combination. * although I could do that and it would work fine *. I rather have all my food displayed in a table for a particular brand (where brand represents 1 entry in the products table).

Long sotry short: Adding new tables gets to the core of the product. I may have to make many logic branches in the shopping_cart class, the product_info.php file etc etc.

I need to understand in some kind of flow chart high level way the mechanisms behind product attributes and how product attributes gets assigned to the shopping_cart class. Basically, I am starting very slowly to understand some of the mechanisms by reverse engineering. But this is a slow and error prone way to about it.

There must be in the hands of some developers some form of planning chart or diagram showing how each piece of the puzzle fits together. I've gone through the enclosed 114 page documentation, which has some noce suggestions of customizations but only on a superficial level. I really need to get into the meat and bones of oscommerce and for that I need to understand more about how the oscommerce logic is put together.

In particular: what are the mechanisms of a user adding an attribute--> getiing that attribute assigned to the class--> Basket table updated--> convert to order etc. I'll need to mirror the same logic for my grig_attibutes.

Thanks in advance. I hope someone can help me to help improve oscommerce.
imqqmi
I know exactly what you mean. I've spend a lot of time searching for documentation as the sourcecode (let alone others' contribs) are not commented. I'm by no means a hard core developer and only dived right into this because I had no choice. I would start a wiki for developers but v3 is around the corner so I guess v2.2 will be phased out soon.

I can only help you with your first question: how are attributes stored. In a post on the mysql forum I've made an illustration of how the products and attributes relate to each other and has helped me greatly to understand how the database is set up.

the header is the table name with the columns as subheaders:



I've highlighted with colors which ID's match in each table. You can see that the products table has a matching products_id in products_attributes. Each product can have multiple attributes assigned, stored in each row of the products_attributes table. So there can be more than one products_id in the attrib table. please see myphpadmin (if your host supports this tool) and look in the database.

The designers made a mistake in naming ID's as in the products_attributes table there's a options_id and options_values_id, which matches with the differently named products_options_id and products_options_values_id. I didn't know that at the time I made the illustration.

The products_options_id describe the group name of an attribute (like color) and products_options_values_id describes the kind of attribute, like blue, red or orange. ID's are of course numbers only, each table (products_options and products_options) also contains a name field which has a string.

When an attribute is assigned/added to a product, a new row is added to the products_attributes table, when an attribute is removed, the row is removed also. There's no enabled/disabled toggle as one would expect, although this is much more efficient space wise, it can be difficult to check which are present and which aren't.

I haven't touched the shopping cart yet, I can't comment on that but it would be best to print out the class (or use multiple monitors to lay source code side by side and go through it all, adding comments when certain parts are understood.

I hope version 3 will be better commented and documented. At least its more object oriented now so it should be easier to understand and extend.

Good luck!

QUOTE (aspiringdeveloper @ Apr 18 2008, 06:11 PM) *
I hate to double post but in the installation & configuration forum I am not getting much help. this topic http://forums.oscommerce.com/index.php?showtopic=298652 is more of a core development issue. If a seaoned php developer can please read the thread (only 8 posts) it would really help me out.

Basically my proposed mod adds a few new tables. : grid_attibutes, grid_row_col.

Some products will have grid atributes which basically mean an an entry in the grid_attibutes table for each row/col cell in the table. The table will have prices shown.

To illustrate: I sell pet food in various flavours and various bag sizes. Its foolish to set up an individual attribute for each flavour-size combination. * although I could do that and it would work fine *. I rather have all my food displayed in a table for a particular brand (where brand represents 1 entry in the products table).

Long sotry short: Adding new tables gets to the core of the product. I may have to make many logic branches in the shopping_cart class, the product_info.php file etc etc.

I need to understand in some kind of flow chart high level way the mechanisms behind product attributes and how product attributes gets assigned to the shopping_cart class. Basically, I am starting very slowly to understand some of the mechanisms by reverse engineering. But this is a slow and error prone way to about it.

There must be in the hands of some developers some form of planning chart or diagram showing how each piece of the puzzle fits together. I've gone through the enclosed 114 page documentation, which has some noce suggestions of customizations but only on a superficial level. I really need to get into the meat and bones of oscommerce and for that I need to understand more about how the oscommerce logic is put together.

In particular: what are the mechanisms of a user adding an attribute--> getiing that attribute assigned to the class--> Basket table updated--> convert to order etc. I'll need to mirror the same logic for my grig_attibutes.

Thanks in advance. I hope someone can help me to help improve oscommerce.
aspiringdeveloper
QUOTE (imqqmi @ Apr 19 2008, 09:29 AM) *
I know exactly what you mean. I've spend a lot of time searching for documentation as the sourcecode (let alone others' contribs) are not commented. I'm by no means a hard core developer and only dived right into this because I had no choice. I would start a wiki for developers but v3 is around the corner so I guess v2.2 will be phased out soon.

I can only help you with your first question: how are attributes stored. In a post on the mysql forum I've made an illustration of how the products and attributes relate to each other and has helped me greatly to understand how the database is set up.

the header is the table name with the columns as subheaders:



I've highlighted with colors which ID's match in each table. You can see that the products table has a matching products_id in products_attributes. Each product can have multiple attributes assigned, stored in each row of the products_attributes table. So there can be more than one products_id in the attrib table. please see myphpadmin (if your host supports this tool) and look in the database.

The designers made a mistake in naming ID's as in the products_attributes table there's a options_id and options_values_id, which matches with the differently named products_options_id and products_options_values_id. I didn't know that at the time I made the illustration.

The products_options_id describe the group name of an attribute (like color) and products_options_values_id describes the kind of attribute, like blue, red or orange. ID's are of course numbers only, each table (products_options and products_options) also contains a name field which has a string.

When an attribute is assigned/added to a product, a new row is added to the products_attributes table, when an attribute is removed, the row is removed also. There's no enabled/disabled toggle as one would expect, although this is much more efficient space wise, it can be difficult to check which are present and which aren't.

I haven't touched the shopping cart yet, I can't comment on that but it would be best to print out the class (or use multiple monitors to lay source code side by side and go through it all, adding comments when certain parts are understood.

I hope version 3 will be better commented and documented. At least its more object oriented now so it should be easier to understand and extend.

Good luck!



Thanks for your input. Yes I have already disected the table format used by the application. Your notes validate the same things I have discovered.

I am making my contribution extremely modular and totally object oriented. My goal is to make minimal changes to the existing code but rather instead add a couple of new class modules that get imported by application_top.php. This will make the mod portable so that when v3 comes out, I'll be able to adapt it.

I am trying to minimize the changes needed to the database table structure. I am only adding 2 new tables so that once again the mod will be easy to install to either v2 or v3 of oscommerce.

You raise a good point about documentation. I should start the project by documenting each class module. The most important class for me is the shopping_cart class. This class I will unfortunately need to add some new methods to support my grid object.

Thanks
aspiringdeveloper
QUOTE (aspiringdeveloper @ Apr 19 2008, 02:53 PM) *
Thanks for your input. Yes I have already disected the table format used by the application. Your notes validate the same things I have discovered.

I am making my contribution extremely modular and totally object oriented. My goal is to make minimal changes to the existing code but rather instead add a couple of new class modules that get imported by application_top.php. This will make the mod portable so that when v3 comes out, I'll be able to adapt it.

I am trying to minimize the changes needed to the database table structure. I am only adding 2 new tables so that once again the mod will be easy to install to either v2 or v3 of oscommerce.

You raise a good point about documentation. I should start the project by documenting each class module. The most important class for me is the shopping_cart class. This class I will unfortunately need to add some new methods to support my grid object.

Thanks




I have good news to report. I have finished devopement of the first major milestone of the grid project. The mod now allows the shopper to add grid products to their shopping carts. The grid is table of href price links that trigger grid identifier for a product that is a member of a grid. The modification handles the row and column intersection and is able to direct the appication properly.

The bad news is that for now I am still testing and the only way to add grid information is through phpadmin. I still have to program the input interface now.

After that, the next challenge will be to contol the inventory quantities in the grid product list.

Still a lot of work to do.

PS- the modification so far has led to changes in about 6 files and 1 new file. I was hoping to minimize the changes but its proving to be a pretty major mod. I am not sure how easy it will be for members to simply install the mod. The installation may require a long list of copy-paste instructions to make the php script file changes. If I just upload new php scripts, people will overwrite their existing scripts and loose whatever other mods they have installed.
aspiringdeveloper
QUOTE (aspiringdeveloper @ Apr 28 2008, 06:36 PM) *
I have good news to report. I have finished devopement of the first major milestone of the grid project. The mod now allows the shopper to add grid products to their shopping carts. The grid is table of href price links that trigger grid identifier for a product that is a member of a grid. The modification handles the row and column intersection and is able to direct the appication properly.

The bad news is that for now I am still testing and the only way to add grid information is through phpadmin. I still have to program the input interface now.

After that, the next challenge will be to contol the inventory quantities in the grid product list.

Still a lot of work to do.

PS- the modification so far has led to changes in about 6 files and 1 new file. I was hoping to minimize the changes but its proving to be a pretty major mod. I am not sure how easy it will be for members to simply install the mod. The installation may require a long list of copy-paste instructions to make the php script file changes. If I just upload new php scripts, people will overwrite their existing scripts and loose whatever other mods they have installed.



More good news smile.gif

The administration of assigning grid products is complete. In products attributes, I have added a section for grid attributes. So the input interface is complete.

Next on the todo list:

Incorporate inventory controls, special pricing, some validation checks to add.

I have a question to you modders out there: Would you like me to release the partially finished mod as is for now while I continue to tweak it, or should I finish the tweaking first?
aspiringdeveloper
QUOTE (aspiringdeveloper @ May 12 2008, 02:50 PM) *
More good news smile.gif

The administration of assigning grid products is complete. In products attributes, I have added a section for grid attributes. So the input interface is complete.

Next on the todo list:

Incorporate inventory controls, special pricing, some validation checks to add.

I have a question to you modders out there: Would you like me to release the partially finished mod as is for now while I continue to tweak it, or should I finish the tweaking first?


Phew, finally all done. Where do I upload my contribution?
burt
Sounds like a really interesting module - looking forward to trying it.

http://addons.oscommerce.com/category/new,package
aspiringdeveloper
QUOTE (burt @ May 21 2008, 03:55 PM) *
Sounds like a really interesting module - looking forward to trying it.

http://addons.oscommerce.com/category/new,package


Okay here it is

Documentation is outstanding because I need some feedback from users. Please backup the files being replaced by this extensive mod

http://addons.oscommerce.com/info/5959
burt
Testing it now. Will feedback later on.
aspiringdeveloper
QUOTE (burt @ May 21 2008, 05:19 PM) *
Testing it now. Will feedback later on.


One quick comment- You'll see a create gid button at the top of the form for entering and editing products in the administration mode under products and categories. Once you drill down to an individual product where you would input the english and multilanguage product descriptions that is where you will find the create grid button.

Happy testing everyone. I am looking forward to your feedback.
burt
PHP5 only will turn a lot of users off.

Anyway, installed on localhost. What's the next step? I don't see any changes in products_attributes other than a blank dropdown with a submit button next to it...install is as per your files - I just overwrote the existing oscommerce files.

Maybe make a readme so that we can get an idea of what it does, how it works, how to insert a grid etc...
aspiringdeveloper
QUOTE (burt @ May 21 2008, 05:39 PM) *
PHP5 only will turn a lot of users off.

Anyway, installed on localhost. What's the next step? I don't see any changes in products_attributes other than a blank dropdown with a submit button next to it...install is as per your files - I just overwrote the existing oscommerce files.

Maybe make a readme so that we can get an idea of what it does, how it works, how to insert a grid etc...


Sorry PHP 5 for now but probably a simple fix for later on. I am assuming most people use php5 by now..

See my comment above about the create grid button. A readme with pictures and more complete documentation will follow. PHP4 compatitablity should be a very easy fix but I can only do so much.. I still have a lot of work on my own website to do.
aspiringdeveloper
QUOTE (burt @ May 21 2008, 05:39 PM) *
PHP5 only will turn a lot of users off.

Anyway, installed on localhost. What's the next step? I don't see any changes in products_attributes other than a blank dropdown with a submit button next to it...install is as per your files - I just overwrote the existing oscommerce files.

Maybe make a readme so that we can get an idea of what it does, how it works, how to insert a grid etc...


Sorry PHP 5 for now but probably a simple fix for later on.

See my comment above about the create grid button. A readme with pictures and more complete documentation will follow. PHP4 compatitablity should be a very easy fix but I can only do so much.. I still have a lot of work on my own website to do.

EDIT:

Let me elaborate on the php5 compatibility:

For reasons of my own site stability, I don't want to be switching back and forth to php4 just to test. Therefor I propose to the mod community to look at the core class of my mod: grid.php. See what is in there that is php 5 specific and post back.

Next, in the catalog folder I made a small change to the Includes/application_top.php as well as the admin/Includes/application_top.php for registering the session variable for the grid class. I MAY have accidently used php 5 specific commands for that when there was no reason for it. I'll see If I can make that change. We are only talking 2-3 lines of code- not a big deal but I have no way to test.

The grid.php class file should be fine in terms of Php 4 compatibility.
aspiringdeveloper
QUOTE (aspiringdeveloper @ May 21 2008, 04:48 PM) *
Sorry PHP 5 for now but probably a simple fix for later on.

See my comment above about the create grid button. A readme with pictures and more complete documentation will follow. PHP4 compatitablity should be a very easy fix but I can only do so much.. I still have a lot of work on my own website to do.

EDIT:

Let me elaborate on the php5 compatibility:

For reasons of my own site stability, I don't want to be switching back and forth to php4 just to test. Therefor I propose to the mod community to look at the core class of my mod: grid.php. See what is in there that is php 5 specific and post back.

Next, in the catalog folder I made a small change to the Includes/application_top.php as well as the admin/Includes/application_top.php for registering the session variable for the grid class. I MAY have accidently Lused php 5 specific commands for that when there was no reason for it. I'll see If I can make that change. We are only talking 2-3 lines of code- not a big deal but I have no way to test.

The grid.php class file should be fine in terms of Php 4 compatibility.


Well I've looked at the SESSION variables and everything is php4 /php5 compatible as far as I can tell. The only thing I can think of is that the way in which the class object is called is creating a confusion in php 4. The grid class itself is straight forward php4 /php 5 compatible.

Like I said, I am only able to confirm that my mod is php5 compatible but I am stumped as to why its not working in php4.
seank123
This looks like it could be very useful - installed but all I get in the catalog is:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /public_html/catalog2/includes/classes/grid.php on line 4

And in Admin->categories/products:

Fatal error: Call to undefined function: tep_hide_session_id() in /public_html/catalog2/admin/categories.php on line 780

In Admin->products attributes:

Fatal error: Call to a member function on a non-object in /public_html/catalog2/admin/products_attributes.php on line 36

Any ideas why?

Cheers for your time.
aspiringdeveloper
QUOTE (seank123 @ May 22 2008, 08:10 AM) *
This looks like it could be very useful - installed but all I get in the catalog is:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /public_html/catalog2/includes/classes/grid.php on line 4

And in Admin->categories/products:

Fatal error: Call to undefined function: tep_hide_session_id() in /public_html/catalog2/admin/categories.php on line 780

In Admin->products attributes:

Fatal error: Call to a member function on a non-object in /public_html/catalog2/admin/products_attributes.php on line 36

Any ideas why?

Cheers for your time.



Are you using php4? Php 4 has some differences. Anyone have any ides?



aspiringdeveloper
QUOTE (aspiringdeveloper @ May 22 2008, 02:21 PM) *
Are you using php4? Php 4 has some differences. Anyone have any ides?


Also did you make sure your configure.php files all point to your catalog2 new install? I hate to ask the obvious but just in case.

Another Idea: In the first 8 lines of the grid.php class are the variable decalations - public and protected.

Change the words 'public' for 'var'

IE:
CODE
public $currentpid;
public $currentlang;
public $heading;
public $gridtable;
protected $counter;
public $rowid;
public $colid;
public $gridarr;
...



Becomes:

CODE
var $currentpid;
var $currentlang;
var $heading;
var $gridtable;
var $counter;
var $rowid;
var $colid;
var $gridarr;
...
aspiringdeveloper
If anyone else has finds and compatibility issues please post back.
aspiringdeveloper
I provided some screen shots in the contributions link. Remember to access grid attributes you first need to define a grid in the products screen for the product of interest.
aspiringdeveloper
I can't over emphasize-When you run it for the first time, you NEED to create the grid in the in the Admin->categories/products.
The first time the grid is initialized, it creates two new tables for you but you must initialize them with the Create Grid button first in Admin->categories/products before going to Admin->products attributes.
aspiringdeveloper
So any news yet? I need someone to get this working and post a success story to serve as a catalyst for others to start downloading. I really believe this to be the next evolution in attributes.


The new version 1.0 I uploaded is a complete package with the changes discussed in the thread that hopefully fixes the php4 compatibility. I'll start working on an installation guide for people wishing to install the mod piece-meal style- ie patching manually the changed files. This is important for people that don't want to thrash their entire heavily modded installation with my modded files. EG- instead of replacing application_top.php with my modded application_top.php, you would instead be instructed to copy specific text to the file.


In the meantime, if you have a test bed catalog with a virgin R2.2, then its worth giving this a try. I need some testimonials from people to get this ball rolling. In addition, if its not working for you you, I need to know ASAP so that we can fix the problem.
aspiringdeveloper
QUOTE (aspiringdeveloper @ May 23 2008, 03:04 PM) *
So any news yet? I need someone to get this working and post a success story to serve as a catalyst for others to start downloading. I really believe this to be the next evolution in attributes.


The new version 1.0 I uploaded is a complete package with the changes discussed in the thread that hopefully fixes the php4 compatibility. I'll start working on an installation guide for people wishing to install the mod piece-meal style- ie patching manually the changed files. This is important for people that don't want to thrash their entire heavily modded installation with my modded files. EG- instead of replacing application_top.php with my modded application_top.php, you would instead be instructed to copy specific text to the file.


In the meantime, if you have a test bed catalog with a virgin R2.2, then its worth giving this a try. I need some testimonials from people to get this ball rolling. In addition, if its not working for you you, I need to know ASAP so that we can fix the problem.



You guys need to help me out here. Nobody told me that php4 doesn't support 'public function' in classes. Anyway, V1.1 uploaded should fix that.

All my knowledge about php is coming from books I read on Php5, which I assumed everyone was using.

Someone please post me a success story besides me. Its working for me that's for sure.

http://addons.oscommerce.com/info/5959
aspiringdeveloper
QUOTE (aspiringdeveloper @ May 24 2008, 01:11 PM) *
You guys need to help me out here. Nobody told me that php4 doesn't support 'public function' in classes. Anyway, V1.1 uploaded should fix that.

All my knowledge about php is coming from books I read on Php5, which I assumed everyone was using.

Someone please post me a success story besides me. Its working for me that's for sure.

http://addons.oscommerce.com/info/5959


Am I talking to myself or what??
aspiringdeveloper
Now available for download are the changes required to the various files for those masochists who don't want to download and replace with my modified files but prefer to copy/paste the changes themselves.

http://addons.oscommerce.com/info/5959
ms-signs
I think it a great adea, something I can really us on my site. I'm trying on a virgin R2.2 test site, before installing on my site. Its running on php4 it set "Current row label:" and "Current col label:" and all I get is a blank drop down menu, How can I edit? how can't make it to work? I switch to php5 and when I set "Current row label:" and "Current col label I get error messages:

Warning: Invalid argument supplied for foreach() in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 553

Warning: Invalid argument supplied for foreach() in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 559

Warning: Invalid argument supplied for foreach() in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 592

Warning: reset() [function.reset]: Passed variable is not an array or object in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 598

Warning: Invalid argument supplied for foreach() in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 600

Warning: Invalid argument supplied for foreach() in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 609

Warning: reset() [function.reset]: Passed variable is not an array or object in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 615

Warning: Invalid argument supplied for foreach() in /hermes/bosweb/web281/b2813/ipw.mssigns/public_html/catalog/admin/includes/classes/grid.php on line 617

I Know notting about php! I did the installation in php4, can this be the problem?
burt
The reason why you are getting little feedback is because the contribution is unintuitive & hard to understand.

The 1st thing I mentioned was "it's PHP5 only" - as the developer of the contribution I assumed (wrongly it seems) that you knew you had coded this for 5 only.

Anyway - when you eventually write a proper readme/howto, you'll get lots more feedback. Most people here just run a live store - and who wants to add this to a live store just to see if it works?

aspiringdeveloper
QUOTE (burt @ May 26 2008, 09:03 AM) *
The reason why you are getting little feedback is because the contribution is unintuitive & hard to understand.

The 1st thing I mentioned was "it's PHP5 only" - as the developer of the contribution I assumed (wrongly it seems) that you knew you had coded this for 5 only.

Anyway - when you eventually write a proper readme/howto, you'll get lots more feedback. Most people here just run a live store - and who wants to add this to a live store just to see if it works?


First of all, I posted a how to update the require files so that the user doesn't need to replace application_top.php but can have more control by applying the patch manually.

Secondly, I assumed wrongly myself that most people are using php5 but honestly I was so deep into the coding that I had forgotten to consider that some may prefer php4 therefore I had to re-work the code.


Third, I want feedback because then I know people are trying it and I can see if there are improvements to make. I am still waiting for someone to try it and post back.
aspiringdeveloper
I have uploaded this to my server while its awaiting approval in the contributes section.


Documentation including screen shots
aspiringdeveloper
QUOTE (ms-signs @ May 26 2008, 04:31 AM) *
...

I Know notting about php! I did the installation in php4, can this be the problem?



Good question. My knowledge is php5 and I am hoping for someone to point out where the non-backward compatible commands are. Does php4 use the foreach statement? I thought so but I notice none of the default files in oscommerce use foreach.

Make sure also you're using the latest grid.php file. See version 1.2 uploaded. In the earlier version I had some offending commands (public function.. not supported in php4). Make sure you don't see the words 'public function' anywhere in the grid.php file (*both in catalog/includes/classes and in admin/includes/classes*).


If you already did it in php4 then stick to php4 - don't switch back and forth.

Regarding editing the drop down row label, column label- see the documentation I uploaded. See my post above.
ms-signs
do you have any screen shots of how it displays in product listing or a website I can see.
ms-signs
QUOTE (ms-signs @ May 26 2008, 04:31 PM) *
do you have any screen shots of how it displays in product listing or a website I can see.


I found it!!!
aspiringdeveloper
QUOTE (ms-signs @ May 26 2008, 05:38 PM) *
I found it!!!


Did you install manually or use my modded files directly? If you need to start from scratch then I recommend php5 if you have a choice. If you already committed to php4- then don't switch back and forth especially not on your live store.
spooks
I have a query, there are some others with this problem, how difficult do you think it would be to modify this contrib to provide for calculations in the cart where there variable dimensions, such as pricing curtains by variable drop & width.

If you think this is way off the mark please say.

smile.gif
aspiringdeveloper
QUOTE (spooks @ May 26 2008, 08:11 PM) *
I have a query, there are some others with this problem, how difficult do you think it would be to modify this contrib to provide for calculations in the cart where there variable dimensions, such as pricing curtains by variable drop & width.

If you think this is way off the mark please say.

smile.gif


I suppose if I was a store selling curtains I would want the pricing for a curtain to be dependent on the length of the cut curtain. Eg: the cell variable would be a price of $a per linear foot, for a certain range, another price for a different range.

Each row in the table is a range of values and the cell attribute can calculate based on the proper strata. Rows would be one dimension, 'Drop' and columns 'Width. Each row would need to cover a range for the 'Drop' dimension (in inches) and each column a range of 'Width' (in inches). There really isn't any calculation at all since the cell intersection will a yield a given Drop/Width combination and result in the price.

EX: Width 36-40 inches is $40.00 for drop of 50-56inches,
EX: Width 36-40 inches is $45.00 for drop of 60-66 inches,
EX: Width 40-46 inches is $48.00 for drop of 50-56 inches,
etc.

No calculation required since the strata covers the pricing variability.


A comments box would be needed to specify the EXACT dimensions for made to order that are not exactly this dimension.

You need to elaborate more on the need. I think anything is doable.

First, I need to see some testimonials of people getting this to work as it is. Then we can expand upon it.
aspiringdeveloper
QUOTE (ms-signs @ May 26 2008, 05:31 PM) *
do you have any screen shots of how it displays in product listing or a website I can see.


See your PM- If it fixes your problem I'll upload it for everyone.
seank123
Hi - been away for a bit so only just seen the new PHP4 compatible version - thanks for your time. Mostly works now.... Unfortuantly, when I go to Admin->Categories/Products I get:

Fatal error: Call to undefined function: tep_hide_session_id() in /public_html/catalog2/admin/categories.php on line 780

Cheers for any help!

aspiringdeveloper
QUOTE (seank123 @ May 27 2008, 10:01 AM) *
Hi - been away for a bit so only just seen the new PHP4 compatible version - thanks for your time. Mostly works now.... Unfortuantly, when I go to Admin->Categories/Products I get:

Fatal error: Call to undefined function: tep_hide_session_id() in /public_html/catalog2/admin/categories.php on line 780

Cheers for any help!


That error isn't even on a line that corresponds to any of the changes I made in categories.php. Try clearing your cookies. Also, try the manual edit method of the files that I uploaded.
aspiringdeveloper
QUOTE (seank123 @ May 27 2008, 11:01 AM) *
Hi - been away for a bit so only just seen the new PHP4 compatible version - thanks for your time. Mostly works now.... Unfortuantly, when I go to Admin->Categories/Products I get:

Fatal error: Call to undefined function: tep_hide_session_id() in /public_html/catalog2/admin/categories.php on line 780

Cheers for any help!


The application_top.php loads the module html_output.php where tep_hide_session_id() resides. If its giving you that error, then function tep_hide_session_id() is not being loaded. Try resorting back to the original categories.php file to see if it fixes the problem. If the problem persists, then we'll look elsewhere. M

Did you check t your admin/includes/functions/html_outp­ut.php file for the following code:

////
// Hide form elements
function tep_hide_session_id() {
$string = ';

if (defined('SID') && tep_not_null(SID)) {
$string = tep_draw_hidden_field(tep_session_­ name(), tep_session_id());
}

return $string;
}


That should be present if not then please add it.
aspiringdeveloper
Here is the latest documentation, and GridV1_3.php class module for download:

Grid Class module
Documentation - detailed file changes
Live Demo:



Screenshot:

aspiringdeveloper
Please use new thread
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.