changing 'genres' to extract other data in static blocks 12 and 13

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

Profile photo of Saguaros 0.00 $tone July 29, 2014
Public

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.

#1
Profile photo of Alan Crookes 0.00 $tone July 29, 2014
Public

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($_producttruetrue)?>
                    </li>


Attachment 38835

#2
Profile photo of Saguaros 0.00 $tone July 31, 2014
Public

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($_producttruetrue)?>


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($_producttruetrue)?>


Remember to clean magento cache and re-index data then

#3
Profile photo of Saguaros 0.00 $tone August 4, 2014
Public

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($_producttruetrue)?>


3. Clear magento cache and re-index data

and let me know how it goes.

#5
Profile photo of Saguaros 0.00 $tone August 8, 2014
Public

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.

#9
Profile photo of Alan Crookes 0.00 $tone August 8, 2014
Public

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. πŸ™

#10
Profile photo of Seoki Lee 1510.00 $tone September 3, 2014
Public

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.

#19
Profile photo of Seoki Lee 1510.00 $tone September 4, 2014
Public

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>
#21

This question is now closed

Written By

Comments