Text "Product Code:" disappear when change charac.

  • Posts: 63
  • Thank you received: 2
12 years 10 months ago #34934

Hi,

In view->product->show i have moved the code that shows the product code in the tittle to a place above Price in. and added the text something like that:

echo "Product Code ".$this->element->product_code;

it comes up alright but when we i select a different characteristic it disapperas.

i am working on a localhost.

lastest hikashop business
joomla 1.7.3

thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
12 years 10 months ago #34977

Could you give the lines of code that you have now ?

It definitely comes from your modification but without knowing exactly what you did, it will be hard to tell you exactly what is the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 63
  • Thank you received: 2
12 years 10 months ago #35028

Hi,
thanks fot the reply.

all the code is original as i have only changed line 27 which i have highlighted. it works fine but upon changing the characteristic. it disappers.

<?php
/**
* @package HikaShop for Joomla!
* @version 1.5.5
* @author hikashop.com
* @copyright (C) 2010-2011 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<div id="hikashop_product_<?php echo @$this->element->product_code; ?>_page" class="hikashop_product_page">
<?php if(empty($this->element)){
$app =& JFactory::getApplication();
$app->enqueueMessage(JText::_('PRODUCT_NOT_FOUND'));
}else{
?>
<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" enctype="multipart/form-data">
<div id="hikashop_product_top_part" class="hikashop_product_top_part">
<h1>
<span id="hikashop_product_name_main" class="hikashop_product_name_main">
<?php
echo $this->element->product_name;
?>
</span>
<span id="hikashop_product_code_main" class="hikashop_product_code_main">
<?php
echo"-- Product Code: ".$this->element->product_code;
?>
</span>
</h1>
<?php

Last edit: 12 years 10 months ago by leowaqqas.

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
12 years 10 months ago #35060

You can either move your code outside of the <span id="hikashop_product_code_main" class="hikashop_product_code_main"> tag or add also your modification on that line of that same file:
<?php echo $variant->product_code;?>

Please Log in or Create an account to join the conversation.

  • Posts: 63
  • Thank you received: 2
12 years 10 months ago #35094

Thank you very much. worked great. :)

Please Log in or Create an account to join the conversation.

  • Posts: 23
  • Thank you received: 0
11 years 9 months ago #86206

Hello,
I have used this to also put my product # above the add to cart button and worked fine. The problem I have is when a variant is chosen with a different code#, the code# doesn't change as it does on the description line.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #86333

Hi,

Can you give us the part of the code where you made the modification ?

Please Log in or Create an account to join the conversation.

  • Posts: 23
  • Thank you received: 0
11 years 9 months ago #86459

The link to a sample page is prm-atv.com/honda/honda-atv-s/trx450r/pr...d-trx450r-450er.html . When the option is changed, the code appending to the description is changed but the part number I have added stays to what the default thickness coming in was.


<?php
}
}
if (!$this->params->get('catalogue') && ($this->config->get('display_add_to_cart_for_free_products') || !empty ($this->element->prices))) {
if (!empty ($this->itemFields)) {
$form = ',\'hikashop_product_form\'';
if ($this->config->get('redirect_url_after_add_cart', 'stay_if_cart') == 'ask_user') {
?>
<input type="hidden" name="popup" value="1"/>
<?php
}
$this->setLayout('show_block_custom_item');
echo $this->loadTemplate();
}
}
$this->formName = $form;
if($this->params->get('show_price')){ ?>
<span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main">
</span>
<?php } ?>
<?php
echo"Part #: ".$this->element->product_code;
?>
<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
<?php
$this->row = & $this->element;
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>

Please Log in or Create an account to join the conversation.

Time to create page: 0.094 seconds
Powered by Kunena Forum