Price per square meter

  • Posts: 1
  • Thank you received: 0
8 years 9 months ago #208456

-- HikaShop version -- : 2.5.0.
-- Joomla version -- : 3.4.3.
-- PHP version -- : 5.4.36
-- Browser(s) name and version -- : chrome

Selling tiles need te be displayed in price per piece (carton) and price per square meter (in the carton).
It is possible to add a price per kg. but is it also possible to add add/display a price per sm,square meter, m2?

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

  • Posts: 12953
  • Thank you received: 1778
8 years 9 months ago #208462

Hello,
You can sell you products per m2 by creating product per m2, but another solution can be to use the following plugin, and create a "width" and "length" custom ITEM fields which will be used with that plugin. So your that your customers will just have to set a width/length and the price will be automatically calculated.

Attachments:
Last edit: 8 years 9 months ago by Mohamed Thelji.

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

  • Posts: 31
  • Thank you received: 2
  • Hikashop Business
7 years 11 months ago #239304

Can you share a link on how to do this to calculate price? I need it in yards and 1/4 yard increments for fabric. I do not see how the client can insert a numerical value to calculate the price:

zigzagsewingstudio.com/index.php/shop/fa...uct/104-test-product

Last edit: 7 years 11 months ago by drfenning.

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

  • Posts: 13201
  • Thank you received: 2322
7 years 11 months ago #239317

Hi,

As mentioned by Mmohamed Thelji to use this plugin, you have to create custom item fields and display them on frontend.
Then once the plugin enabled it will calculate the price based on the values filled by the customer for these fields.

But the customer will be able to set any values, so if you need the calculation in yards and with an increment by 1/4 it will require custom code. If you are not a developer, you can post a request in the commercial jobs section of this forum or contact a third developer.
Here is the developer documentation: www.hikashop.com/support/documentation/6...r-documentation.html

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

  • Posts: 42
  • Thank you received: 1
7 years 10 months ago #241734

I have installed the suggested plugin for calculating width x length and enabled it, however I cannot find any options for this on my products page. I am using Hikashop Starter. Do I need to upgrade to get this functionality? Also, is there any documentation on how to use the plugin?

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 10 months ago #241753

Hi,

You need to create two custom fields of the table "item" via the menu Display>Custom fields named "width" and "length". This requires the Business edition of HikaShop.

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

  • Posts: 42
  • Thank you received: 1
7 years 10 months ago #241791

Damn, I've just bought the Essential package thinking all I needed was Product Options... need to upgrade already! :(

Thank Nicolas :)

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

  • Posts: 42
  • Thank you received: 1
7 years 10 months ago #241794

Is there any documentation for this plugin?

Since upgrading to Business the ability to select the fields in the Product details seems to have vanished and is now replaced with this...

Attachments:
Last edit: 7 years 10 months ago by info@flashpoint.net.au.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 10 months ago #241810

Hi,

There are two lines written in our FAQ but that's all you need. The plugin needs to be enabled with two custom item fields "width" and "length" configured to be displayed on the product page.
It's normal that you don't see them in the backend edition page of the product since they're supposed to be displayed on the frontend product page.

We've changed the custom fields display settings in the latest version. So if you have a problem with their display, try downloading again the install package of HikaShop on our website and install it on yours (in order to get the latest patches), and then edit the settings of the field and check that the display settings are correct, and save them.

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

  • Posts: 42
  • Thank you received: 1
7 years 7 months ago #248617

Hi,

I have upgraded to both Joomla 3.6.2 and HikaShop Business 2.6.3 and the custom_quantity_width_length plugin no longer works?

Notice: Undefined property: stdClass::$length in /home/hpshutters/public_html/components/com_hikashop/views/product/tmpl/show_block_custom_item.php on line 14

Is there an update for this plugin or is it some other problem?

www.hpshutters.com.au/order-online

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

  • Posts: 42
  • Thank you received: 1
7 years 7 months ago #248618

Sorry... the plugin still appears to work as far as doing the calculations, but the default values have vanished and the error message appears twice immediately above the width/length custom fields!

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

  • Posts: 12953
  • Thank you received: 1778
7 years 7 months ago #248620

Hello,

Your issue doesn't seem to come from the plugin but probably from a view's customization (the "show_block_custom_item" file of the "product" view of your front-end template that you can check via "Hikashop->Display->Views").

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

  • Posts: 42
  • Thank you received: 1
7 years 7 months ago #248789

OK... I have checked the view's customization, however I don't really know what I'm looking at!!!

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.6.3
 * @author	hikashop.com
 * @copyright	(C) 2010-2016 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_custom_item_info" class="hikashop_product_custom_item_info">
	<table width="100%">
<?php
	foreach ($this->itemFields as $fieldName => $oneExtraField) {
		$itemData = JRequest::getString('item_data_' . $fieldName, $this->element->$fieldName);
?>
		<tr id="hikashop_item_<?php echo $oneExtraField->field_namekey; ?>" class="hikashop_item_<?php echo $oneExtraField->field_namekey;?>_line">
			<td class="key">
				<span id="hikashop_product_custom_item_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_name"><?php
					echo $this->fieldsClass->getFieldName($oneExtraField);
				?></span>
			</td>
			<td>
				<span id="hikashop_product_custom_item_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_item_value"><?php
					$onWhat='onchange';
					if($oneExtraField->field_type=='radio')
						$onWhat='onclick';
					$oneExtraField->product_id = $this->element->product_id;
					echo $this->fieldsClass->display(
						$oneExtraField,
						$itemData,
						'data[item]['.$oneExtraField->field_namekey.']',
						false,
						' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'item\',0);"'
					);
				?></span>
			</td>
		</tr>
<?php
	}
?>
	</table>
</div>

Can you please advise what I need to do to fix the problem. I haven't changed anything other than upgrade the component, so I dont understand why it has happened in the first place!

Last edit: 7 years 7 months ago by nicolas.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #248800

Hi,

You want to change the code:
$this->element->$fieldName
to:
@$this->element->$fieldName in that view file.

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

  • Posts: 42
  • Thank you received: 1
7 years 7 months ago #249024

Thanks Nicolas, however it hasn't solved the problem, but created more... I changed the line 14 in the show_block_custom_item view from:
$itemData = JRequest::getString('item_data_' . $fieldName, $this->element->$fieldName);
to:
$itemData = JRequest::getString('item_data_' . $fieldName, @$this->element->$fieldName);

It removed all product options and re-positioned the Add to Cart button over the product image :(

Is there any other suggestions?

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #249039

Hi,

The modification I proposed is just to remove the error message.
It's not possible that it influences something else like removing the options, or changing the positions of the elements on the page.
So the problems you're describing come from something else.
Could you provide a link to the page with the problems you're talking about ? And maybe a screenshot of what should be where ?

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

  • Posts: 42
  • Thank you received: 1
7 years 7 months ago #249430

Hi Nicolas,

The link to the page I'm trying to troubleshoot is www.hpshutters.com.au/order-online

I currently have line 14 in the the "show_block_custom_item" file of the "product" view set as it was originally:
$itemData = JRequest::getString('item_data_' . $fieldName, $this->element->$fieldName);
I get this result:



When I change line 14 code to:
$itemData = JRequest::getString('item_data_' . $fieldName, @$this->element->$fieldName);
I get this result:


All options have been removed and the Add to cart button sits over the image!

The default values for my custom fields are: width: 3500 & length: 2500 however these values aren't displayed. This wasn't the case before upgrading both Joomla and HikaShop. Everything was working fine prior to the upgrade and I haven't done anything else to the configuration. Please help!

Attachments:

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #249438

Hi,

As expected the problem isn't coming from my proposed change.
If you leave the code as before and instead turn off the "error reporting" setting of the Joomla configuration you'll get the same issue.
The problem you have is a byproduct of the change. The issue is a CSS issue which happens because of how you configured your image. You set it to fill the whole page. But the layout of a product page is to have the image on the left and the add to cart/attributes area on the right. So it's actually normal that the image and the right area are mingled like that.
You were just lucky that the error message pushed the right area below the left area.
But normally, you should add custom CSS to do that:
#hikashop_product_left_part{ width: 100% !important; }

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

  • Posts: 42
  • Thank you received: 1
7 years 7 months ago #249511

Thanks, although I have no idea where to put your suggested CSS code: #hikashop_product_left_part{ width: 100% !important; }

I have resized my images to suit the product page layout, however the error messages still appear! I suspect this is a separate issue to my original query regarding my default values...

As previously stated... the default values for my custom fields are: width: 3500 & length: 2500 however these values aren't being displayed. The length/width plugin is working in as much as it is calculating any values entered, but why aren't the default values being displayed as they were before upgrading?

Attachments:
Last edit: 7 years 7 months ago by info@flashpoint.net.au.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #249553

Hi,

Several things here:

1. Here is how to add CSS:
www.hikashop.com/support/documentation/1...ize-the-display.html

2. The custom fields are looking for the default values in the columns "width" and "length" of the products.
The error messages say that these columns do not exist.
So I suppose that you must have removed such custom fields, or you did something with the database.

The width and length you can enter as dimensions of the product in the default interface are in product_width and product_length, not width and length. So if you say that you entered the dimensions there, it's normal that the custom fields are not picking them up since they have a different name.

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

Time to create page: 0.159 seconds
Powered by Kunena Forum