Product Creation Related Questions

  • Posts: 8
  • Thank you received: 0
7 years 6 months ago #269765

Hi HikaShop ! Can you please advise re. the following questions :

1) Frontend HikaShop Checkout Page (option=com_hikashop&view=checkout&layout=show&Itemid=XXX) : The site I'm using HikaShop on requires 'registration' or 'login' before purchase. After either 'registration' or 'login' on 'HikaShop' Checkout' page I need to force a page 'refresh' to change of the status of the sites main login module from 'login' to 'logout' (Change in login module status only occurs after page refresh). As such I need to add something like 'window.top.location.reload(); - into your ajax success callback, somewhere in code for both for both checkout page 'registration' or 'login' functions. Could you please advise on how to do this.

2) Product setup page : Is it possible set 'defaults' for product 'height - width - depth' ? My Client packs 90% of products into one box size (other 10% into second box size). To save time & improve data entry accuracy it would be great to set default Product default measurements.

3) Product setup page > Initial 'Product variant' setup : When creating a new 'Product Variant' Is there a way make that 'Product variant' a 'Clone' of the 'Main product' - 'Retail price', 'Quantity per order', 'height - width - depth' , 'description', 'Images' etc. copied to 'Cloned Variant'. The Client can then simply change the 'Variant' elements that need to be changed & 'save' - so fast, so clean.

(Having run an online shop for years I can tell you from personal experience that the 'eShop product creation process' - starting with the setting up of the 'Product' for photography > to photo crop/retouch each image in photoshop > to on-line 'Product creation' in shopping cart - takes AT LEAST 10 minutes P/product (That's for one set of photos for one 'Product' - no variants') - thus anything that saves time & increases accuracy is a very good thing = 'Product' to 'Variant' Cloning).

Also, I notice that if a 'Product variant' photo is not saved during 'Product variant' setup then if 'System > Configuration > Display > Default Parameters For Divs > Type of item layout > is set to 'image & title' - then the system's 'Default image' displays in 'show_block_cart' section of the 'view=checkout&layout=show&Itemid=XXX' page - this is not good, don't you think it would be better to automatically show the 'Main product image' on checkout page if no 'Product variant' image is set?

4) Brand Image : On 'Product Page' how can I show a 'Brand' image (logo) ? Currently On 'Product Page' I only get the 'Brands' name & click link to a 'listings page'. On that 'listings page' the 'Brands' image (Logo) doesn't display, just the list.

Thanks - Paulzero

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 6 months ago #269799

Hi,

1.
You can use such code to do that:

window.Oby.registerAjax(['checkout.user.updated'], function(params){
window.top.location.reload();
});
Such javascript can be added anywhere on the page. I'd recommend in the "show" file of the "checkout" view via the menu Display>Views.

2. There is no option.
You would have to edit the file "form" of the view "product" for your backend template in order to add that in that code:
	if(hikashop_acl('product/edit/volume')) { ?>
			<dt class="hikashop_product_volume"><label for="data_product__product_length"><?php echo JText::_('PRODUCT_VOLUME'); ?></label></dt>
			<dd class="hikashop_product_volume">
				<div class="input-prepend">
					<span class="add-on"><?php
						echo str_replace('#MYTEXT#', '<i class="hk-icon-14 icon-14-length"></i>', hikashop_tooltip(JText::_('PRODUCT_LENGTH'), '', '', '#MYTEXT#', '', 0));
					?></span>
					<input size="10" style="width:50px" type="text" id="data_product__product_length" name="data[product][product_length]" value="<?php echo $this->escape(@$this->product->product_length); ?>"/>
				</div>
				<div class="input-prepend">
					<span class="add-on"><?php
						echo str_replace('#MYTEXT#', '<i class="hk-icon-14 icon-14-width"></i>', hikashop_tooltip(JText::_('PRODUCT_WIDTH'), '', '', '#MYTEXT#', '', 0));
					?></span>
					<input size="10" style="width:50px" type="text" id="data_product__product_width" name="data[product][product_width]" value="<?php echo $this->escape(@$this->product->product_width); ?>"/>
				</div>
				<div class="input-prepend">
					<span class="add-on"><?php
						echo str_replace('#MYTEXT#', '<i class="hk-icon-14 icon-14-height"></i>', hikashop_tooltip(JText::_('PRODUCT_HEIGHT'), '', '', '#MYTEXT#', '', 0));
					?></span>
					<input size="10" style="width:50px" type="text" id="data_product__product_height" name="data[product][product_height]" value="<?php echo $this->escape(@$this->product->product_height); ?>"/>
				</div>
				<?php echo $this->volume->display('data[product][product_dimension_unit]', @$this->product->product_dimension_unit, 'dimension', '', 'class="no-chzn" style="width:93px;"'); ?>
			</dd>
<?php
	}

3. I don't recommend doing that. It will be so much longer to maintain in the future.
You might actually not know but you don't need to fill anything in the variants. The data that you don't enter in the variants is automatically taken from the main product. That way, when you want to change it in the future, instead of having to update all the variants one by one with the same change, you can just update the data in the main product and all the variants will automatically use the new data. I see it as even better than prefilling the variants with the data from the main product when you edit them.

3.1 regarding the variants default image on the checkout cart, I tried to reproduce the problem but it's working fine on my end. First the default item layout has no link with the way show_block_cart display itself, and on my end, the main product image is automatically used when the variant doesn't have one itself, whether the variant has been edited and saved, or not.

4. You'll have to edit the file "show_block_dimensions" and at the bottom modify the code of the brand display to include the image of the brand. Here is a thread about that:
www.hikashop.com/forum/product-category-...-display.html#160508

Last edit: 7 years 6 months ago by nicolas.

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

  • Posts: 8
  • Thank you received: 0
7 years 6 months ago #269849

Hi Nicolas !

Thanks for great reply !


Re : #1 - Unfortunately ' window.Oby.registerAjax(, function(params){ window.top.location.reload();}); ' not working for me. It appears that 'checkout / show_block_shipping.php' is not getting refreshed after 'login'.

To test I just put :

Test:<?php
$user =& JFactory::getUser();
$usr_name = $user->get('username');
echo $usr_name;
?>

into the top of 'checkout / show_block_shipping.php' - If I 'login' on Checkout page 'Test' shows nothing & the 'Shipping Methods' do not display (Because ''checkout / show_block_shipping.php' hasn't been refreshed - or something). If I now refresh the whole page using Browser Refresh (F5) , page re-displays & 'Test' shows logged-in User name & 'Shipping Methods' display.

Any ideas on how I might fix this.

Re : #2 - Thanks for code - Can I use it anywhere within 'administrator/components/com_hikashop/views/product/tmpl/form.php' ?

Re : #3 - Sweet ! My mistake - was testing using 'Sample Data' where 'Sample Data > Star stilettos' had an image saved with each 'Color' variant. Created dummy 'Main Product' then 'Product Variants' & all data from 'Main Product' is being used by 'Product Variants' - thank you.

Re : #4 - Got it ! But - would be great to merge this sample code :

<div class="custom_brand_image" style="text-align:center;padding:">		
	<?php
	if($this->config->get('manufacturer_display', 0) && !empty($this->element->product_manufacturer_id)){
	$class = hikashop_get('class.category');
	$manufacturer = $class->get($this->element->product_manufacturer_id, true);
	global $Itemid;
	$categoryClass = hikashop_get('class.category');
	$categoryClass->addAlias($manufacturer);
	echo $this->image->display($manufacturer->file_path,false,$manufacturer->file_name, '', '', $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);
	}
	?>
</div>

with this code from 'components/com_hikashop/views/product/tmpl/show_block_dimensions.php' - L55 :
if($this->config->get('manufacturer_display', 0) && !empty($this->element->product_manufacturer_id)){
	$categoryClass = hikashop_get('class.category');
	$manufacturer = $categoryClass->get($this->element->product_manufacturer_id);
	if($manufacturer->category_published){
		$menuClass = hikashop_get('class.menus');
		$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
		if(empty($Itemid)){
			$Itemid = $menuClass->loadAMenuItemId('','');
		}
		$categoryClass->addAlias($manufacturer);
		echo "<p style='text-align:center;color:black;margin: 0px !important;'>" . JText::_('MANUFACTURER').': '.'<a style="color:black;" href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a></p>' ;

		echo "<span style='display:none;' itemprop='brand'>". $manufacturer->category_name ."</span>";
	}
}

To create a Clickable href link from 'Manufacturer' Logo/Image to 'Manufacture' Product listing.

Cheers - Paulzero

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 6 months ago #269852

Hi,

1. My bad. The forum stripped some piece of the javascript code I had in my message. I've added it back to my previous message.

2. No. That's the original code from the view file where the modifications have to be done. I didn't provide exact modifications to be done since I don't know what you want exactly. Note that it's better to modify it through a view override via the menu Display>Views.

4. People might not want the image so by default we don't add it. And on top of that, that would require an extra query all the time on the product page for something which might not be needed most of the time. And finally, that would also create issues with people updating that would get the brand image on their product page whilie they might not want it and it might break their product page layout. So adding that by default is not something I see, at least in the short term. But you're welcome to integrate that yourself in that view file for your needs.

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

  • Posts: 8
  • Thank you received: 0
7 years 6 months ago #269893

Hi Nicolas !

Thanks for great reply again !

1) Great - working now !

2) OK - Will have a go !

4) See your point - current mod. to show logo works for me.

Cheers - Paulzero

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

Time to create page: 0.064 seconds
Powered by Kunena Forum