Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Add Model Number to Specials Page

Add Model Number to Specials Page

Views: 1,193

Results 1 to 10 of 10
20 Sep 2013, 12:54 PM
#1
aimwilk avatar

aimwilk

New Zenner

Join Date:
Jan 2011
Posts:
10
Plugin Contributions:
0

Add Model Number to Specials Page

I would like to add the model number below the image on the specials page. The grid layout mod is installed with the template, not sure why it only shows up on the specials page because my layout is set to rows. But that's ok, as long as I can find the code to add model #. Thanks for any help.

22 Sep 2013, 3:16 AM
#3
aimwilk avatar

aimwilk

New Zenner

Join Date:
Jan 2011
Posts:
10
Plugin Contributions:
0

Re: Add Model Number to Specials Page

Thank you, this does help, though the model number displays after the price. I will play around with this to try and get it to display after the image. If anyone is better at code and can give me the info, I would certainly appreciate it. If not, when I get this straight I'll post the code for others.

22 Sep 2013, 1:18 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Add Model Number to Specials Page

Possibly, if we can see the site to see what you have now.

2 Oct 2013, 9:30 PM
#5
aimwilk avatar

aimwilk

New Zenner

Join Date:
Jan 2011
Posts:
10
Plugin Contributions:
0

Re: Add Model Number to Specials Page

stevesh:

Possibly, if we can see the site to see what you have now.

Since I don't own the site and just work as a freelance designer, I don't feel comfortable or free to post their webpage. But the current order on the specials is the image, then name/title, then price, then the percentage off. I'd like the model number to go just below the image.

Thanks to anyone who can help, and I'll work on it here as well.

2 Oct 2013, 10:01 PM
#6
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Add Model Number to Specials Page

aimwilk:

Since I don't own the site and just work as a freelance designer, I don't feel comfortable or free to post their webpage. But the current order on the specials is the image, then name/title, then price, then the percentage off. I'd like the model number to go just below the image.

Thanks to anyone who can help, and I'll work on it here as well.

/includes/modules/pages/specials/main_template_vars.php

add p.products_model to the $specials_query_raw

then find the section of code:
'text' => '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . (($specials->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : zen_image(DIR_WS_IMAGES . $specials->fields['products_image'], $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>') . '<br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . $products_price);

replace with:
'text' => '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . (($specials->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : zen_image(DIR_WS_IMAGES . $specials->fields['products_image'], $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>') . '<br />' . $specials->fields['products_model'] . '<br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . $products_price);

8 Oct 2013, 11:17 PM
#7
aimwilk avatar

aimwilk

New Zenner

Join Date:
Jan 2011
Posts:
10
Plugin Contributions:
0

Re: Add Model Number to Specials Page

rbarbour:

/includes/modules/pages/specials/main_template_vars.php

add p.products_model to the $specials_query_raw

then find the section of code:
'text' => '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . (($specials->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : zen_image(DIR_WS_IMAGES . $specials->fields['products_image'], $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>') . '<br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . $products_price);

replace with:
'text' => '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . (($specials->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : zen_image(DIR_WS_IMAGES . $specials->fields['products_image'], $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>') . '<br />' . $specials->fields['products_model'] . '<br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . $products_price);

This is just not working correctly for some reason. I was able to add the model number to includes/modules/mytemplate/specials_index.php to show on the main page by adding p.products_model to $specials_index_query and editing the following code. How do I rearrange this code so that the model number shows up under the image?

$specials_index->fields['products_name'] = zen_get_products_name($specials_index->fields['products_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . (int)$specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . $specials_index->fields['products_id']) . '">' . $specials_index->fields['products_name'] . '</a><br />' . $products_price . '<br />' . $specials_index->fields['products_model']);

Thanks to anyone who can help, and for any ideas on why I can't get this same type of display on the 'specials' page.

9 Oct 2013, 12:16 AM
#8
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Add Model Number to Specials Page

aimwilk:

I would like to add the model number below the image on the specials page. The grid layout mod is installed with the template, not sure why it only shows up on the specials page because my layout is set to rows. But that's ok, as long as I can find the code to add model #. Thanks for any help.

aimwilk:

This is just not working correctly for some reason. I was able to add the model number to includes/modules/mytemplate/specials_index.php to show on the main page by adding p.products_model to $specials_index_query and editing the following code. How do I rearrange this code so that the model number shows up under the image?

$specials_index->fields['products_name'] = zen_get_products_name($specials_index->fields['products_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . (int)$specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . $specials_index->fields['products_id']) . '">' . $specials_index->fields['products_name'] . '</a><br />' . $products_price . '<br />' . $specials_index->fields['products_model']);

Thanks to anyone who can help, and for any ideas on why I can't get this same type of display on the 'specials' page.

Your first post was asking for the code to display on the specials page, this last post is saying you implemented on the main page.

Do you want it on the specials page?

Do you want it in the main page specials centerbox?

Both have similar code but different files.

Use the code I provided for the specials page, use the code you have for the main page specials centerbox, placing your code in the same position I placed my code will put the Model Number under the image.

9 Oct 2013, 2:01 AM
#9
aimwilk avatar

aimwilk

New Zenner

Join Date:
Jan 2011
Posts:
10
Plugin Contributions:
0

Re: Add Model Number to Specials Page

rbarbour:

Your first post was asking for the code to display on the specials page, this last post is saying you implemented on the main page.

Do you want it on the specials page?

Do you want it in the main page specials centerbox?

Both have similar code but different files.

Use the code I provided for the specials page, use the code you have for the main page specials centerbox, placing your code in the same position I placed my code will put the Model Number under the image.

Sorry for the confusion. I originally wanted to add the model number to the specials page and had no luck, but then tried adding it to the index/main page and got it there, just in the wrong place.
I did get your code to work correctly on the specials page, thank you SO much. The problem was in the template override I set up. Thank the Lord that is solved.
So now I just need to move the model number up on the main/index page and I'm sure will get this up and running.
Thank you very much for all of the help.

9 Oct 2013, 2:14 AM
#10
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Add Model Number to Specials Page

aimwilk:

I would like to add the model number below the image on the specials page. The grid layout mod is installed with the template, not sure why it only shows up on the specials page because my layout is set to rows. But that's ok, as long as I can find the code to add model #. Thanks for any help.

aimwilk:

Sorry for the confusion. I originally wanted to add the model number to the specials page and had no luck, but then tried adding it to the index/main page and got it there, just in the wrong place.
I did get your code to work correctly on the specials page, thank you SO much. The problem was in the template override I set up. Thank the Lord that is solved.
So now I just need to move the model number up on the main/index page and I'm sure will get this up and running.
Thank you very much for all of the help.

Glad you got it working!