Text on Product Page

  • Posts: 89
  • Thank you received: 2
5 years 2 weeks ago #312817

-- url of the page with the problem -- : synncomwebhosting.co.za
-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.2
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : None - N/A

Good Day,

How would I update all Product Descriptions in BULK.?
Is there a Mass Action I can create to do this and if yes - how?

So for example - I would like to add a bit of text to every Product Description :
"Please note although we have prices on Products you would need to request a Quote due to Exchange Rate."

Last edit: 5 years 2 weeks ago by Uriel.

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

  • Posts: 12953
  • Thank you received: 1778
5 years 2 weeks ago #312820

Hello,

Sure, you'll just have to create a mass action which will update the values of the product_description column of the product table.

Kind regards,
Mohamed.

Attachments:
Last edit: 5 years 2 weeks ago by Mohamed Thelji.

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

  • Posts: 89
  • Thank you received: 2
5 years 2 weeks ago #312854

Hi Mohamed, thank you for your reply.

Could you please let me know in a bit more detail how to do this?
This is on a LIVE site and I can't afford to mess it up, therefor I am requesting more details please?

I am able to get to a certain point but I don't know what to add further in the Action:




Furthermore - This Action Value states "Update the Values" - Does this mean it would update the entire value and remove what is in there already? - I need it to ADD a bit of text and leave the original Product Description.

Attachments:
Last edit: 5 years 2 weeks ago by Uriel.

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
5 years 2 weeks ago #312860

Hi,

Yes, this update the values action will remove what is there already.
So you add your text at the end, you can use the type "operation" instead of "int" and use a concat operation like this:
concat(product.product_description, 'my text at the end')
I would recommend to test mass actions on a copy of the website or do a backup before as mass actions can have a big impact if not configured properly or if there is a bug (you never know).

Also, if you just want to add some text below the description on the product page, I would rather recommend to edit the file show_default via the menu Display>Views and add your text at the end. It will be easier, safer and easier to change the text in the future if necessary.

Last edit: 5 years 2 weeks ago by nicolas.

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

  • Posts: 89
  • Thank you received: 2
5 years 2 weeks ago #312892

Hi Nicolas, Thank you for the comprehensive reply.

I like your suggestion of editing the "show-default" File....

So I am attaching the code of the file you mentioned - All I want is for each Product to state this on TOP in the Product Description :
"Please note although we have prices on Products you would need to request a Quote due to Exchange Rate."

Where in the file would I please this text?


<?php
/**
 * @package	HikaShop for Joomla!
 * @version	4.0.3
 * @author	hikashop.com
 * @copyright	(C) 2010-2019 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><div id="hikashop_product_top_part" class="hikashop_product_top_part">
<?php if(!empty($this->element->extraData->topBegin)) { echo implode("\r\n",$this->element->extraData->topBegin); } ?>
	<h1>
		<span id="hikashop_product_name_main" class="hikashop_product_name_main" itemprop="name"><?php
			if(hikashop_getCID('product_id') != $this->element->product_id && isset($this->element->main->product_name))
				echo $this->element->main->product_name;
			else
				echo $this->element->product_name;
		?></span>
<?php if ($this->config->get('show_code')) { ?>
		<span id="hikashop_product_code_main" class="hikashop_product_code_main" itemprop="sku"><?php
			echo $this->element->product_code;
		?></span>
<?php } ?>
	</h1>
<?php if(!empty($this->element->extraData->topEnd)) { echo implode("\r\n", $this->element->extraData->topEnd); } ?>

<?php
	$this->setLayout('show_block_social');
	echo $this->loadTemplate();
?>
</div>

<div class="hk-row-fluid">

	<div id="hikashop_product_left_part" class="hikashop_product_left_part hkc-md-6">
<?php if(!empty($this->element->extraData->leftBegin)) { echo implode("\r\n",$this->element->extraData->leftBegin); } ?>
<?php
	$this->row =& $this->element;
	$this->setLayout('show_block_img');
	echo $this->loadTemplate();
?>
<?php if(!empty($this->element->extraData->leftEnd)) { echo implode("\r\n",$this->element->extraData->leftEnd); } ?>
	</div>

	<div id="hikashop_product_right_part" class="hikashop_product_right_part hkc-md-6">
<?php if(!empty($this->element->extraData->rightBegin)) { echo implode("\r\n",$this->element->extraData->rightBegin); } ?>

		<div id="hikashop_product_vote_mini" class="hikashop_product_vote_mini"><?php
	if($this->params->get('show_vote_product')) {
		$js = '';
		$this->params->set('vote_type', 'product');
		$this->params->set('vote_ref_id', isset($this->element->main) ? (int)$this->element->main->product_id : (int)$this->element->product_id );
		echo hikashop_getLayout('vote', 'mini', $this->params, $js);
	}
		?></div>
		<span id="hikashop_product_price_main" class="hikashop_product_price_main" itemprop="offers" itemscope itemtype="https://schema.org/Offer">
<?php
	$main =& $this->element;
	if(!empty($this->element->main))
		$main =& $this->element->main;
	if(!empty($main->product_condition)){
?>
			<meta itemprop="itemCondition" itemtype="https://schema.org/OfferItemCondition" content="https://schema.org/<?php echo $main->product_condition; ?>" />
<?php
	}
	if($this->params->get('show_price') && (empty($this->displayVariants['prices']) || $this->params->get('characteristic_display') != 'list')) {
		$this->row =& $this->element;
		$this->setLayout('listing_price');
		echo $this->loadTemplate();
?>
			<meta itemprop="availability" content="https://schema.org/<?php echo ($this->row->product_quantity != 0) ? 'InStock' : 'OutOfstock' ;?>" />
			<meta itemprop="priceCurrency" content="<?php echo $this->currency->currency_code; ?>" />
<?php
	}
?>
		</span>

<?php if(!empty($this->element->extraData->rightMiddle)) { echo implode("\r\n",$this->element->extraData->rightMiddle); } ?>

<?php
	$this->setLayout('show_block_dimensions');
	echo $this->loadTemplate();
?>
		<br />
<?php
	if($this->params->get('characteristic_display') != 'list') {
		$this->setLayout('show_block_characteristic');
		echo $this->loadTemplate();
?>
		<br />
<?php } ?>

<?php
	$form = ',0';
	if(!$this->config->get('ajax_add_to_cart', 1)) {
		$form = ',\'hikashop_product_form\'';
	}

	if(hikashop_level(1) && !empty ($this->element->options)) {
?>
		<div id="hikashop_product_options" class="hikashop_product_options"><?php
			$this->setLayout('option');
			echo $this->loadTemplate();
		?></div>
		<br />
<?php
		$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
		}
	}

	if(!$this->params->get('catalogue') && ($this->config->get('display_add_to_cart_for_free_products') || ($this->config->get('display_add_to_wishlist_for_free_products', 1) && hikashop_level(1) && $this->params->get('add_to_wishlist') && $this->config->get('enable_wishlist', 1)) || !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
	}

	if(empty($this->element->characteristics) || $this->params->get('characteristic_display') != 'list') {
?>
		<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(\'' . (int)$this->element->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
			$this->setLayout('quantity');
			echo $this->loadTemplate();
		?></div>
<?php
	}
?>

		<div id="hikashop_product_contact_main" class="hikashop_product_contact_main"><?php
	$contact = (int)$this->config->get('product_contact', 0);
	if(hikashop_level(1) && ($contact == 2 || ($contact == 1 && !empty($this->element->product_contact)))) {
		$css_button = $this->config->get('css_button', 'hikabtn');
?>
			<a href="<?php echo hikashop_completeLink('product&task=contact&cid=' . (int)$this->element->product_id . $this->url_itemid); ?>" class="<?php echo $css_button; ?>"><?php
				echo JText::_('CONTACT_US_FOR_INFO');
			?></a>
<?php
	}
?>
		</div>

<?php
	if(!empty($this->fields)) {
		$this->setLayout('show_block_custom_main');
		echo $this->loadTemplate();
	}

	if(HIKASHOP_J30) {
		$this->setLayout('show_block_tags');
		echo $this->loadTemplate();
	}
?>
	<span id="hikashop_product_id_main" class="hikashop_product_id_main">
		<input type="hidden" name="product_id" value="<?php echo (int)$this->element->product_id; ?>" />
	</span>

<?php if(!empty($this->element->extraData->rightEnd)) { echo implode("\r\n",$this->element->extraData->rightEnd); } ?>

</div>
</div>

<div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part">

<?php if(!empty($this->element->extraData->bottomBegin)) { echo implode("\r\n",$this->element->extraData->bottomBegin); } ?>

	<span id="hikashop_product_url_main" class="hikashop_product_url_main"><?php
		if(!empty($this->element->product_url)) {
			echo JText::sprintf('MANUFACTURER_URL', '<a href="' . $this->element->product_url . '" target="_blank">' . $this->element->product_url . '</a>');
		}
	?></span>

<?php
	$this->setLayout('show_block_product_files');
	echo $this->loadTemplate();
?>

<?php if(!empty($this->element->extraData->bottomMiddle)) { echo implode("\r\n",$this->element->extraData->bottomMiddle); } ?>
<?php if(!empty($this->element->extraData->bottomEnd)) { echo implode("\r\n",$this->element->extraData->bottomEnd); } ?>
</div>
<div id="hikashop_product_description_main" class="hikashop_product_description_main" itemprop="description"><?php
		echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description));
	?></div>

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
5 years 2 weeks ago #312896

Hi,

Well, search for "description" in that file, and you'll see that the description is displayed by this code:

<div id="hikashop_product_description_main" class="hikashop_product_description_main" itemprop="description"><?php
		echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description));
	?></div>
So just add your text before that code.

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

  • Posts: 89
  • Thank you received: 2
5 years 5 days ago #313308

Hi Nicolas,

Client changed their mind and now want a text bit below the Price.
How would I do this?

Please see attached Screenshot:

Attachments:

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
5 years 5 days ago #313311

Hi,

You can add your text before or after the line:

<?php if(!empty($this->element->extraData->rightMiddle)) { echo implode("\r\n",$this->element->extraData->rightMiddle); } ?>

The following user(s) said Thank You: Uriel

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

  • Posts: 89
  • Thank you received: 2
5 years 5 days ago #313331

Great! Works Perfectly - Thank you Nicolas

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

Time to create page: 0.092 seconds
Powered by Kunena Forum