Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with Optional Related Products


rickhudson

Recommended Posts

I have recently installed the Optional Related Products contribution:

 

http://www.oscommerce.com/community/contributions,2293

 

Though this contribution works perfectly, there appears to be an issue when making changes to the entries (via the Edit function). When a change is made to either the linked product or the sort order and you click on "Update", the values are not updated or stored in the database, therefore when the screen refreshes, the previous values are displayed.

 

I've looked through the script and can't find any issues in the code - does anyone else have any ideas or has previously come across this issue?

 

Thanks in advance.

 

Richard

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...
Here's the solution:

 

On or around line 147, find: method="get"

 

Replace it with: method="post"

 

This is form name="attributes", in version 3.2 and above.

 

-Skittles

Oh, Bother!

 

That simple fix does indeed allow you to update the sort order. However, it breaks the rest of the functions!

 

I'll keep working on this. I'll get back to you when I figure it out...

 

-Skittles

Link to comment
Share on other sites

Success!

 

I believe I have fixed the problem! And this time, I tested all the other functions, and they still work. :blush:

 

Okay. In admin/products_options.php, look for this line of code, (around line 244):

			<td align="center" class="smallText"> <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> <?php echo '<a href="' . tep_href_link(FILENAME_RELATED_PRODUCTS, '&attribute_page=' . $attribute_page . '&products_id_view='.$products_id_view, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a> </td>

 

And replace if with this line of code:

			<td align="center" class="smallText"> <input type="hidden" name="action" value="update_product_attribute"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> <?php echo '<a href="' . tep_href_link(FILENAME_RELATED_PRODUCTS, '&attribute_page=' . $attribute_page . '&products_id_view='.$products_id_view, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a> </td>

 

It adds the following hidden input:

<input type="hidden" name="action" value="update_product_attribute">

 

-Skittles

Link to comment
Share on other sites

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...