Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Sort v1.4 problems


Recommended Posts

Hello,

 

After installing this new mod I am having an error when I click on Admin > Catalog:

 

Parse error: unexpected "<" in /admin/categories.php

 

So I looked at the code, and realized it was breaking my php tag following it. I then put the code *ABOVE* where you showed, instead of *BELOW* per your instructions, and now it doesn't error, but it's not working completely correct just yet. It is just not displaying correctly in admin > catalog > categories/products page, but it's very close. :D It's not spaced properly. for instance,

 

Product-sort order - status is how it goes now, and it's all jumbled together, bunched up with no spacing between each other. I hope to fix this up if noone else does, and renew the mod version in contribs. If someone else figures this out, please post your findings/fix here. When I figure it out I will report what I did.

 

Here is the part in the instructions I am having problems with.

 

9. Approximately at lineS 839-843,***

>>> FIND THIS:

? ? ?} else {
? ? ? ?echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
? ? ?}
?></td>
? ? ? ? ? ? ? ?<td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

>>> ADD THIS LINE *BEFORE* THE ABOVE:

<td class="dataTableContent" align="center"><?php echo $products['products_sort_order']; ?></td>

 

 

 

I changed my code to look like this:

 

 ? ? ? ? ? ? ? ?<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . $products['products_name'] . ' ' . $products['products_sort_order']; ?>
? ? ? ? ? ? ? ?
<?php
? ? ?if ($products['products_status'] == '1') {
? ? ? ?echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
? ? ?} else {
? ? ? ?echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
? ? ?}
?></td>

 

here is the exact part I went with:

 

' ' . $products['products_name'] . '</a> ' . $products['products_sort_order']; ?>

Edited by Starkness

Thanks!

 

Starkness

Link to comment
Share on other sites

hmmmm, you can tell it's been a long day when you go back to your site to check what you've done so far and realise that you fixed this contribution this morning ;)

 

here's the code, just replace your section you already pasted with it :)

 

<?php
? ? ?if ($products['products_status'] == '1') {
? ? ? ?echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
} else {
? ? ? ?echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
? ? ?}
?></td>
<td class="dataTableContent" align="center"><?php echo $products['products_sort_order']; ?></td>
? ? ? ? ? ? ? ?<td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
? ? ? ? ? ? ?</tr>

 

I added from the previous PHP tag :D

Edited by pw_cynic
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...