Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Child Attributes for Osc 2.3.1


fnzb

Recommended Posts

Child Attributes for Osc 2.3.1

Released under GNU GPL

By FNZB

 

This contribution will allow you to assign child attributes to product attribute values.

 

For example, if you have 3 Shirt types and each one has different colour options:

 

Shirt Type: (Option Name)

- Shirt 1 (Option value)

- Colour:(Option Name)

- White (Option value)

- Black (Option value)

- Shirt 2

- Colour:

- Red

- White

- Blue

- Shirt 3

- Colour:

-Green

 

I have only taken this to one sub level as that is all I required it for. It could probably be

modified to allow multiple sub levels if required.

 

This contribution can be found here

Link to comment
Share on other sites

  • 4 weeks later...

Hello, I installed this add-on using your installation guide (Beyond Compare is awesome!), however after I try and use it (example: selecting a product from a drop-down menu thats linked to another product) I'm generated this error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where oa.products_id='59' and oa.options_id = '2' and oa.options_value_id='9' an' at line 1

 

select pov.products_options_values_id, pov.products_options_values_name, oa.products_id, oa.options_values_price, oa.price_prefix from child_attributes oa, products_options_values pov where where oa.products_id='59' and oa.options_id = '2' and oa.options_value_id='9' and oa.child_options_id = '1' and oa.child_value_id = pov.products_options_values_id and pov.language_id = '1'

 

[TEP STOP]

 

Any idea how to fix this? This add-on would be amazing for my site!

 

Chris

Edited by Christopher Wright
Link to comment
Share on other sites

Ah, just found the problem myself in catalog/child_attributes.php, line 23 for me.

 

$oa_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, oa.products_id, oa.options_values_price, oa.price_prefix from " . TABLE_CHILD_ATTRIBUTES . " oa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where where oa.products_id='" . (int)$prod_id . "' and oa.options_id = '" . (int)$poid . "' and oa.options_value_id='" . (int)$povid . "' and oa.child_options_id = '" . (int)$oa_options_name['products_options_id'] . "' and oa.child_value_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

Has 'where' declared twice, simple remove one of the 'where's. :)

Edited by Christopher Wright
Link to comment
Share on other sites

Hi Chris,

 

I've had a look in my source files and I don't have a double 'where' on that line. Must have happened when you were editing the files :huh:

 

Glad you found it :thumbsup:

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I just installed this and am getting something funny. I'm trying to add a child attribute, but I can't add any of the "Option Name" or "Option Value" fields. I can go in phpmyadmin and change it through that, but that is cumbersome. I attached a picture of what i'm seeing in the admin page.

 

Can you give me a hint on what I should change?

 

-Jake

post-310309-0-12991000-1334386470_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Hi cyberndj,

 

Sorry I am late with my reply.

 

It looks as though you have added child attributes fine for that product and now it isnt working, is that right?

 

I can't honestly see why that would be the case, maybe a conflict with another addon??

 

You could try adding this in /admin/child_attributes.php:

 

 

echo $oa_action;

 

above this:

 

switch ($oa_action)

 

This will output the action to the screen and you should see like the image attached. By doing this you can at least see if the actions are being called properly, by the look of your image the dropdown boxes arent even showing, they should be there but empty if no options were found for the product.

 

post-303829-0-89058000-1335392384_thumb.png

Link to comment
Share on other sites

  • 2 weeks later...

Hi Hayden,

 

Many thank for this contribution!

I am install this add-on to a fresh installed 2.3.1, have a problem in shopping cart page, top price include both product and attribute price, but sub-total only show the product price, same in right colum shopping cart box too, only display the product price. check out show the price for both product and attribute with no problem.

screenshot attached.

 

Many thanks for your help.

Tim

child_attribute.png

Link to comment
Share on other sites

I am getting this error when I try to delete existing option names or option values:

 

Warning: Cannot modify header information - headers already sent by (output started at *******/admin/products_attributes.php:18) in *******/admin/includes/functions/general.php on line 34

 

 

This is line 18 in products_attributes:

 

<script type="text/javascript">

 

(it is part of the code from your mod that goes like

 

?>

<script type="text/javascript">

function createRequest() {

return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

}

 

etc...)

 

 

This is line 34 in general.php:

 

   header('Location: ' . $url);

 

Neither file has a blank space or line at the beginning or end of the file

 

 

The options do delete, but I still get that error nonetheless.

Link to comment
Share on other sites

  • 4 weeks later...

Hello Hayden,

 

Thanks for your contribution. Your addon looks like it might be what I need, but I am not sure. The products on my site have multiple attributes, and each attribute is dependent on the attribute that is selected before it. The best example I can give you is here: http://www.dartheads.com/products/cylinder-heads/small-block-chevy-iron-heads/iron-eagle-s-s-small-block-chevy-cylinder-head-34.html

 

Would your addon be able to accomplish this similar effect?

 

Thanks again for your hard work.

Link to comment
Share on other sites

Hi everyone,

 

I am having the exact same issue as @@cyberndj. Did anyone find how to fix this issue? I tried displaying various echo before " switch ($oa_action) " but nothing display wich means this page is not even called by my products_attributes.php page.

 

If anyone has found the cause of this issue please reply or PM me please.

Link to comment
Share on other sites

I'm curently investigating on my issue, i notice something quite funny but realy annoying, the option name dropdown list from the products attribute page is replaced by a miniature OSCom login page, if i login to it I am redirected to a new page where the actual functional (with the good options) is displayed.

Link to comment
Share on other sites

Hi,

I had put my store on hold since I was moving and I had to move my home server. After I moved, OSC wasn't displaying right, so I wiped the entire program. I am now going to reinstall OSC and this addon and see if I have the same issue as before. I'll post back with my results (and it won't be as long as between my last post!)

 

-Jake

Link to comment
Share on other sites

Hi cyberndj,

 

Sorry I am late with my reply.

 

It looks as though you have added child attributes fine for that product and now it isnt working, is that right?

 

I can't honestly see why that would be the case, maybe a conflict with another addon??

 

You could try adding this in /admin/child_attributes.php:

 

 

echo $oa_action;

 

above this:

 

switch ($oa_action)

 

This will output the action to the screen and you should see like the image attached. By doing this you can at least see if the actions are being called properly, by the look of your image the dropdown boxes arent even showing, they should be there but empty if no options were found for the product.

 

post-303829-0-89058000-1335392384_thumb.png

Hi,

 

I did a OSC fresh install, and installed only this addon. I followed your advice in your post and still the same thing is happening as my OP.

 

-Jake

Link to comment
Share on other sites

  • 1 year later...

Hi everyone,

 

I am having the exact same issue as @@cyberndj. Did anyone find how to fix this issue? I tried displaying various echo before " switch ($oa_action) " but nothing display wich means this page is not even called by my products_attributes.php page.

 

If anyone has found the cause of this issue please reply or PM me please.

 

 

Anyone able to figure this problem out? I'm having the same issue.

Link to comment
Share on other sites

  • 2 years later...
  • 11 months later...

Hi,

 

Great contribution but little problem in showing tax in product info. We have set up all prices showing incl. tax in our shop but only the child attributes options drop down displays price without tax in product info.  Shopping chart and checkout shows correct prices. Can someone point me where to look.

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...