Hello,
Im after a little help.
In the static blocks 12 and 13, where it pulls the 2 lists of the products. In the products, it lists a genre attribute. I have looked in the template files in the apps folder (most-anticipated.phtml and verticallist.phtml) and found some php code at the bottom. But replacing this with the attribute i wanted to use, didnt work.
Regards,
Alan
22 answers
Greetings Alan,
In this JM Gamestore theme, we create a new attribute called Genres and assign for products, may I know which attribute are you trying to display? You can post the snippet of code you changed here so that I can take a look.
ok, I created a new attribute called ‘race’ I would like to pull the information from that to the page. The code i need to change im guessing it in the most-antisipated.phtml and verticallist.phtml files
PHP Code:
</h5>
<?php $genre= $_product->getAttributeText('genres');?>
<div class="genre">Genre: <?php if($genre) echo($genre); else echo ("N/A");?></div>
<?php echo $this->getReviewsSummaryHtml($_product, true, true)?>
</li>
Attachment 38835
Hi
You’re in right direction. After you create attribute ‘race’ and assign it to appropriate attribute set, please add value for this attribute in settings of product.
Then, for example, if you want it appears in static block called Most Anticipated in position-12 position, you open this php file: \app\design\frontend\default\jm_gametemplate\joom lart\jmproducts\most-anticipated.phtml
Look for this snippet of code:
PHP Code:
<?php $genre= $_product->getAttributeText('genres');?>
<div class="genre">Genre: <?php if($genre) echo($genre); else echo ("N/A");?></div>
<?php echo $this->getReviewsSummaryHtml($_product, true, true)?>
you can change to this:
PHP Code:
<?php $rac= $_product->getAttributeText('race');?>
<div class="genre">Race: <?php if($rac) echo($rac); else echo ("N/A");?></div>
<?php echo $this->getReviewsSummaryHtml($_product, true, true)?>
Remember to clean magento cache and re-index data then
I have made the edit to the code, and flushed both cache and re-index, but its just showing N/A. Do i need to make reference to the attribute set its in?
Hi I will try to explain in details as below:
1. Create attribute:
-- Go to Admin area > Catalog > Attributes > Manage Attributes > Create a new attributes called ‘race’ with configuration as these snapshots:
http://prntscr.com/49gpzj
http://prntscr.com/49gra5
-- GO to Manage attribute sets section and assign this new attribute to an attribute set called ‘jm_gamestore’: http://prntscr.com/49grrd
2. Edit template file:
Open one of above 2 files and make change as I mentioned in my last reply:
PHP Code:
<?php $rac= $_product->getAttributeText('race');?>
<div class="genre">Race: <?php if($rac) echo($rac); else echo ("N/A");?></div>
<?php echo $this->getReviewsSummaryHtml($_product, true, true)?>
3. Clear magento cache and re-index data
and let me know how it goes.
Hi Saguaros,
I have followed that to the letter and still it will not show on the product i made. I really dont know what is going on with it. π
You can PM me URL, admin and ftp credentials of your site, I will take a look.
And try to take a backup of your site first.
Did you get the details?
The culprit here is that when you create a new product, you need to assign ‘jm_gamestore’ attribute set to this product: http://prntscr.com/4aoz5d then in settings of each product, you can select the value for that race attribute. At this moment, you don’t set any value for products so that they will display N/A.
Hi there,
I created a product with the ‘jm_gamestore’ attribute set, and added a ‘race’ value, but still nothing is showing for me, Just ‘N/A’
Im grateful for your help so far, but i just cant work out what is going on here. π
Did you try to clean magento cache and re-index data via Admin > System > Cache management / Index management after changing?
Yep, I do that whenever I make a change. Did you manage to look into the problem in my other thread?
As I can see that you add a sample product with ‘jm_gamestore’ attribute set and it displays in slider in position-13 now: http://prntscr.com/4c3cdg
How come its not displaying on static block 12 though? Its still saying N/A?
I think it might be something with the code, as the demo store on the site is showing the same
http://www.joomlart.com/demo/#jm_gamestore
Only N/A can be seen in static block 12. but 13 has all the information!
There maybe something wrong here, I’m looking at this issue, please give me more time and I will be back asap.
Any update yet?
Please help us check ftp account which you send us, I can not access your site with it:
http://prntscr.com/4ikjkk
I’ve updated on your site. I edited file /app/design/frontend/default/jm_game/template/joomlart/jmproducts/most-anticipated.phtml
Before this rule:
Code:
<?php $rac= $_product->getAttributeText('race');?> <div class="genre">Race: <?php if($rac) echo($rac); else echo ("N/A");?></div> <?php echo $this->getReviewsSummaryHtml($_product, true, true)?>
Added rule:
Code:
<?php $_product = $_product->load($_product->getId());?>
Now it works fine on your site. Please check it.
Thank you so much now just my other problem with the mobile view and im all set!
I’ve fix JM products with mobile view on your site, please check it.
In your home page, I see it call JM products with catid="40", but in your site there isn’t any category with ID is 40. So I update for it and call category with ID is 50.
You can change ID for it by go to your admin >> CMS >> Pages >> Click on your home page >> click on tab "Contents" and edit id in this rule:
Code:
<div>{{block type="joomlart_jmproducts/list" name="view.jmproducts.list" template="joomlart/jmproducts/list-mobile.phtml" catsid="50"}}</div>
Thank you so much
This question is now closed