Hi everyone,
I recently updated to the latest edition of CMSMS and updated my Products module as well. Everything seemed to be working fine until I noticed that the product entries no longer produce a hierarchy_id. Is this a problem isolated to my installation, or is anyone else experiencing this? I had a script in place to display custom breadcrumbs based on hierarchy_id, and now none of my products have one so it isn't working. When I do a print_r for $entry, hierarchy_id is there as an available variable but it is empty. My hierarchies are set up properly, and have ID numbers. All my products have a hierarchy position selected.
Is there another variable I can use to access hierarchy id, name or position by entry?
Here is my version info:
CMS Version
1.9.2
Installed Modules
CMSMailer
2.0
FileManager
1.0.3
MenuManager
1.7.4
ModuleManager
1.4
News
2.11
nuSOAP
1.0.2
Printing
1.1.1
Search
1.6.8
ThemeManager
1.1.3
TinyMCE
2.8.2
FrontEndUsers
1.12.8
CGSimpleSmarty
1.4.7
CGExtensions
1.22.2
SelfRegistration
1.6.7
MyFavorites
1.0
Products
2.9.2
FormBuilder
0.6.4
CGBlog
1.7.1
CustomContent
1.7.3
CGFeedMaker
1.0.11
CGFeedback
1.2.1
running on Current PHP Version (phpversion): 5.2.14
Products Module and Hierarchy ID
Re: Products Module and Hierarchy ID
What view do you mean: summary or detail template?kristy_lb wrote:until I noticed that the product entries no longer produce a hierarchy_id.
Please post the script here as it is impossible to say what is wrong in it without looking into it.kristy_lb wrote:I had a script in place to display custom breadcrumbs based on hierarchy_id, and now none of my products have one so it isn't working.
I have a fresh install ofkristy_lb wrote:When I do a print_r for $entry, hierarchy_id is there as an available variable but it is empty.
CMSMS 1.9.2
CGSimpleSmarty 1.4.7
CGExtensions 1.22.2
Products 2.9.2
and hierarchy_id is filled properly in summary and detail view.
Re: Products Module and Hierarchy ID
I didn't bother to test on the summary view until now. In the summary view it seems to produce the hierarchy_id, but still none in the detail view. Not sure why.Sonya wrote:What view do you mean: summary or detail template?kristy_lb wrote:until I noticed that the product entries no longer produce a hierarchy_id.
I don't imagine there's anything wrong with the script, it worked just fine before when $entry->hierarchy_id produced a value in the detail view, but here it is. I am using hierarchy instead of category as products can be in multiple categories.Sonya wrote:Please post the script here as it is impossible to say what is wrong in it without looking into it.kristy_lb wrote:I had a script in place to display custom breadcrumbs based on hierarchy_id, and now none of my products have one so it isn't working.
{if $entry->hierarchy_id eq "7"}
{assign var='cat' value="Digital"}
{elseif $entry->hierarchy_id eq "8"}
{assign var='cat' value="Splatter"}
{elseif $entry->hierarchy_id eq "9"}
{assign var='cat' value="Fine Art"}
{elseif $entry->hierarchy_id eq "10"}
{assign var='cat' value="Floral"}
{elseif $entry->hierarchy_id eq "11"}
{assign var='cat' value="Grunge"}
{elseif $entry->hierarchy_id eq "12"}
{assign var='cat' value="Nature"}
{/if}
<p class="breadcrumbs"><a href="/">Home</a> > <a href="canvas-art-collections.html">Canvas Art Collections</a> > <a href='canvas-art-collections/{$cat}.html'>{$cat}</a> > {$entry->product_name}</p>
Well I guess it's a good thing it's an isolated problem, I probably have a better chance at fixing it then..Sonya wrote:I have a fresh install ofkristy_lb wrote:When I do a print_r for $entry, hierarchy_id is there as an available variable but it is empty.
CMSMS 1.9.2
CGSimpleSmarty 1.4.7
CGExtensions 1.22.2
Products 2.9.2
and hierarchy_id is filled properly in summary and detail view.
Thank you for your help!
Re: Products Module and Hierarchy ID
You are right. The script relies on $entry->hierarchy_id and if it is not there, then logically script does not work as desired. The issue is that $entry->hierarchy is empty. This variable is filled in modules/Products/action.default.php. Search for the line:kristy_lb wrote:I don't imagine there's anything wrong with the script, it worked just fine before when $entry->hierarchy_id produced a value in the detail view,
Code: Select all
$onerow->hierarchy_id = product_ops::get_product_hierarchy_id($row['id']);
Code: Select all
print '<pre>';
print_r($onerow->hierarchy_id);
print '</pre>';

-
- Forum Members
- Posts: 206
- Joined: Tue Oct 25, 2005 4:50 pm
Re: Products Module and Hierarchy ID
I am having this problem since upgrading to CMSMS 1.9.4.2 "Faanui"
In debug mode I get this error :
Album 0.9.3
Captcha 0.4.3
Cart 1.8.1
CGEcommerceBase 1.3.4
CGExtensions 1.26.6
CGSimpleSmarty 1.4.8
CMSMailer 2.0.1
CustomContent 1.7.3
FileManager 1.1.0
FormBuilder 0.7
FrontEndUsers 1.15
Guestbook 1.3.2
LightBox 1.0.1
MenuManager 1.7.6
ModuleManager 1.4.2
MysqlDump 1.2.3
News 2.11.3
NMS 2.3.2
NMSTrack 1.0
nuSOAP 1.0.2
Orders 1.13
Printing 1.1.2
Products 2.13.3
Search 1.6.10
SelfRegistration 1.6.12
ThemeManager 1.1.4
TinyMCE 2.8.4
In debug mode I get this error :
I have the following modules installed :Notice: Undefined variable: config in /home/1/s/sh/shb3_150/9plusonline.com/public_html/electric-installation-survey-inspection-law-tenerife/modules/Products/action.hierarchy.php on line 60
Notice: Undefined variable: id in /home/1/s/sh/shb3_150/9plusonline.com/public_html/electric-installation-survey-inspection-law-tenerife/modules/Products/action.hierarchy.php on line 80
Notice: Undefined variable: id in /home/1/s/sh/shb3_150/9plusonline.com/public_html/electric-installation-survey-inspection-law-tenerife/modules/Products/action.hierarchy.php on line 84
Album 0.9.3
Captcha 0.4.3
Cart 1.8.1
CGEcommerceBase 1.3.4
CGExtensions 1.26.6
CGSimpleSmarty 1.4.8
CMSMailer 2.0.1
CustomContent 1.7.3
FileManager 1.1.0
FormBuilder 0.7
FrontEndUsers 1.15
Guestbook 1.3.2
LightBox 1.0.1
MenuManager 1.7.6
ModuleManager 1.4.2
MysqlDump 1.2.3
News 2.11.3
NMS 2.3.2
NMSTrack 1.0
nuSOAP 1.0.2
Orders 1.13
Printing 1.1.2
Products 2.13.3
Search 1.6.10
SelfRegistration 1.6.12
ThemeManager 1.1.4
TinyMCE 2.8.4
Re: Products Module and Hierarchy ID
I was never able to get it to work properly so I ended up changing my script:
{if $entry->canonical|truncate:20:"" eq "art/details/Digital/"}
{assign var='cat' value="Digital"}
{if $entry->canonical|truncate:20:"" eq "art/details/Digital/"}
{assign var='cat' value="Digital"}
-
- Forum Members
- Posts: 206
- Joined: Tue Oct 25, 2005 4:50 pm
Re: Products Module and Hierarchy ID
Sorry, I don't understand what this means...kristy_lb wrote:I was never able to get it to work properly so I ended up changing my script:
{if $entry->canonical|truncate:20:"" eq "art/details/Digital/"}
{assign var='cat' value="Digital"}
What did you end up having to change and how did you change it to get the products to show again?
Re: Products Module and Hierarchy ID
$entry->hierarchy_id return hierarchy id in array, not directly as hierarchy id value, so use foreach for get id.
Marek A.
Marek A.