Too much space under product image

  • Posts: 41
  • Thank you received: 0
8 years 5 months ago #219457

-- HikaShop version -- : 2.6.0

Hi I am struggling with the display of images, there is a large gap between the image and the description, is this a configuration issue? I have attached a screenshot to show.

Attachments:

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

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
8 years 5 months ago #219460

Hi,

Yes, it's a configuration issue. Go in your Joomla menu manager and edit your menu item. There, in the "products settings" tab you'll find a width and a height field for the images of the listing so that you can reduce the height and that should help.

The following user(s) said Thank You: Cheesydoodles

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

  • Posts: 41
  • Thank you received: 0
8 years 5 months ago #219506

Sorry I don't quite understand this is not a menu item it is when I click on a category this is what is displayed also the module "recent items" it is happening there also, looked at the module settings but can't figure it out.

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

  • Posts: 41
  • Thank you received: 0
8 years 5 months ago #219531

Found it, it was in the hikashop hidden menus as category layout, played about with the item layout and fixed now
Thank You

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

  • Posts: 13201
  • Thank you received: 2322
8 years 5 months ago #219535

Hi,

So if it is not related on the settings of the menu / module displaying this listing, this is maybe coming from a code we added in order to allow to have the same height for all the divs of a listing.
Please edit the view "product / listing_div" and remove the code:

data-consistencyheight=".hikashop_subcontainer"

www.hikashop.com/support/documentation/s...ize-the-display.html

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

  • Posts: 25
  • Thank you received: 2
7 years 6 months ago #253021

Hi,

I have the data consistency attribute in product / listing_div view yet the listing page has non-consistent box sizes. Am I missing something?

Thank you =)

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

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
7 years 6 months ago #253028

Hi,

I've checked your products listing page but I don't see that parameter there:
take.ms/37yrf
So I don't see why you say that you have it in products/listing_div
Are you sure that you're looking at that view file for the joomla template you're using on your listing, and not for another template of your website ?

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

  • Posts: 25
  • Thank you received: 2
7 years 6 months ago #253890

Hi nicolas,

Thank you for checking, under Display -> Views -> Front End -> Protostar -> Product -> Listing_Div, I do have the consistent height attribute:

<?php
	}
	$attributes = '';
	if($columns>1 && $this->params->get('consistencyheight',1)){
		$attributes .= 'data-consistencyheight=".hikashop_subcontainer"';
	}
?>
	<div class="hikashop_products" <?php echo $attributes; ?>>
and my display option for this particular category is inherit(div). So I must be missing something for the boxes not to be same height but what am I missing?

Also I would like to do the following:

1) Display the sale end date string as "Expiring on (end date)" in the product listing view, under the product name for each product and "Ongoing" for products without sale end date, what should I add in the view file or the language file?

2) Allow the users to sort the product listing based on
a) Sale end date, nearest date to furthest date, followed by those without end date ("Ongoing"), followed by those which sale ended, nearest date to furthest date
b) Product published date, nearest to furthest date

3) Option for user to hide products which sale date ended in the product listing view

Thank you =)

Last edit: 7 years 6 months ago by Jerome. Reason: [code] is nice

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

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
7 years 6 months ago #254033

Hi,

I found the issue I think. It comes from a javascript error.
Replace the line:

if(window.hikaVotes && typeOf(initVote) == 'function')
by:
if(window.hikaVotes && typeof(initVote) == 'function')
in the file media/com_hikashop/js/hikashop.js and that should fix the problem.

1. Something like that:
<?php echo hikashop_getDate($this->row->product_sale_end); ?>

2. You can use the filter system to add sorting:
www.hikashop.com/support/documentation/1...-filter-listing.html

3. You can use this plugin:
www.hikashop.com/support/forum/4-how-to/...ale-date.html#128950

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

  • Posts: 25
  • Thank you received: 2
7 years 5 months ago #254610

Hi nicolas,

Thank you for your replies =)

Realized that after changing the javascript, the container height doesn't get immediately applied correctly (see attachment), and will only display correctly after refreshing the page. Visitors may mistake that the site is faulty. Is there something else that needs to be changed for the browser to render the heights correctly on first loading?

1) As for the calling of product sale end date on the product listing view, I tried this code:

if ($this->row->product_sale_end > date("j-F-Y g:i:A")) {
echo "Promotion will expire " . hikashop_getDate($this->row->product_sale_end);
}else if ($this->row->product_sale_end <= date("j-F-Y g:i:A")) {
echo "Promotion expired";
}else{
echo "Ongoing";
}

but it always returns "Promotion expired" even if the product sale end date is in the future. Is there something else I need to add?

2) If I want the display to sort according to:
a) Active products arranged by product_ID in descending order
b) Expired products (product sale end date over) arranged by product_ID in descending order behind all active products
how do I do that without using filters if I don't want the user to sort it? (I think this is a simpler way than letting users sort themselves)

3) Noted your plugin, thank you =)

Attachments:

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

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
7 years 5 months ago #254634

Hi,

0. If you remove data-consistencyheight=".hikashop_subcontainer" from the listing_div view file, it will remove that problem altogether.

1. The variable $this->row->product_sale_end contains the date in unix timestamp. So instead of date("j-F-Y g:i:A"), you should use date("U") as per the php.net documentation on the date function:
php.net/manual/en/function.date.php

2. Sorting by product_id is easy. Edit your listing menu item via the Joomla menu manager and change the "ordering column" to "product_id" and the "ordering direction" setting to "descending". There is however no system to have several orderings at the same time like you ask in b. To do that, you would have to code your own plugin of the group "hikashop" and implement the onBeforeProductListingLoad trigger where you could set $order yourself:
www.hikashop.com/support/documentation/6...reProductListingLoad

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

  • Posts: 25
  • Thank you received: 2
7 years 5 months ago #254739

Hi nicolas,

0. That makes the subcontainers not have consistent height instead, how to retain the consistent height without having them stack up on first load? (The issue gets resolved on refreshing -> that means Shift+F5 on Chrome will cause the subcontainers to stack, then F5 will let it display normally)

1. I've gotten that part with the code

if ($this->row->product_sale_end > date("U")) {
	echo "Promotion until " . hikashop_getDate($this->row->product_sale_end);
}else if ($this->row->product_sale_end <= date("U")) {
	echo "Promotion expired";
}else if ($this->row->product_sale_end = '') {
	echo "Ongoing";
}
which works except for the last part where product_sale_end is an empty value. Setting it to ($this->row->product_sale_end = 0) doesn't work either. What should I use instead for if product_sale_end has no value (so that it echoes "Ongoing")?

2. To sort the product listing by boolean [(product_sale_end > date("U")) and (product_sale_end is empty) in front, followed by [(product_sale_end <= date("U")], then by (product_id DESC), is that possible to frame it the SQL query of $order? Because I would like it to put the active ones [(product_sale_end > date("U")) and (product_sale_end is empty)] in front but NOT sorted by the sale end date, instead sort the recordset by product_id DESC, and all the expired ones [(product_sale_end <= date("U")] behind again NOT sorted by sale end date, but by product_id DESC. Instead of one recordset, there would be two - to query and return all active products and sort them, and then query and return all expired products and sort them and append them behind the query that returned all active products, is that possible with onBeforeProductListingLoad?

Thank you =)

Last edit: 7 years 5 months ago by Jerome. Reason: [code] is nice

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

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
7 years 5 months ago #254762

Hi,

0. There is a modification in the hikashop.js file to use "min height" instead of height.
But the height consistency feature is using some javascript to calculate the height of the element and set it to all.. If the loading of some elements is not made the height can have some processing issues.

1. If you take a closer look at your code you will see that in the last "if" there is an assignation and not a correspondence check.

$this->row->product_sale_end = ''
so you're modifying the variable to put it an empty string.

2. Sorting on a boolean value is not recommended because there is not enough data to indicate how two elements should be arranged ; but in MySQL queries you can use several sorting columns to not make the result too "random".
Now thanks to the trigger "onBeforeProductListingLoad" you can do a lot of things in the query like adding new fields to retrieve and change the ordering.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 25
  • Thank you received: 2
7 years 5 months ago #254957

Hi Jerome,

0. It is OK in Chrome and mobile IE, just need to reload the page. However it doesn't work on Safari at all - stacked up and doesn't display correctly even after refreshing. Is it a problem with the parents.length and elems.length not being loaded properly? How do I get the height consistency feature to work on first load?

1. Thank you for pointing out, I have modified it and reordered the if else statements so it works now. Here's the code if it could help anyone:

if ($this->row->product_sale_end == '0') {
echo "Ongoing";
}else if ($this->row->product_sale_end > date("U")) {
echo "Promotion until " . hikashop_getDate($this->row->product_sale_end);
}else if ($this->row->product_sale_end <= date("U")) {
echo "Promotion expired";
}

2. I think it's a similar issue to sort a product listing based on unlimited stock, limited stock and no stock? I realised the display requires 3 queries..
a) product_sale_end > date("U"), order by product_id DESC
b) product_sale_end == 0, order by product_id DESC
c) product_sale_end < date ("U") && != 0, order by product_id DESC
How can I get the trigger to sort the product listing according to this configuration?

3. I'm also using the Random Products module but have one issue - how to let the module select ONLY the products that have not past the product_sale_end date? That means don't display expired products.

Thank you =)

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

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
7 years 5 months ago #254983

Hi,

0. Yes, the problem is that the height of the elements provided by the browser on the first load is wrong in some browsers because they try to optimize the loading too much and thus the images are not yet loaded when they call the javascript of the page, which normally shouldn't happen.
As Jerome said, we changed the code there to use min-height instead of height so that way, on the first load, instead of cutting elements when the height provided is wrong, it will just display as if the height wasn't consistent. If you use the latest build of HikaShop 2.6.4, the change has been done in media/com_hikashop/js/hikashop.js for that.
But we don't see any solution to have the consistency height system work all the time.

2. It's not possible to have three different sortings on the same products listing like that. As you say, this would require three queries, and thus you would actually need to have three products listing modules one below another with your plugin's onBeforeProductListingLoad function changing the query in a different way each time.

3. It's the same as point 2, you can use onBeforeProductListingLoad in order to do that.
I had developed a small plugin to do that for all the products listings on the frontend:
www.hikashop.com/support/forum/4-how-to/...ale-date.html#128950
So you can base yourself on that.

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

  • Posts: 25
  • Thank you received: 2
7 years 5 months ago #255124

Hi nicolas,

0. Updated to 2.6.4, the loading issue should be fixed =)

2. I believe repeating the function call 3 times with the trigger activating 3 times will be complicated, as also need to maintain the display flow, instead of displaying 3 form results. An alternative would be to shift all expired products to another category automatically upon expiry (to potentially allow for implementation of add to wishlist function). However this trigger is not available under mass actions. Is there a way to configure expired products to be automatically recategorised upon expiry to another category?

3. The plugin affects all products on front end, I can remove the filters for product_sale_start and product_sale_end=0 to affect only those expired, but how to restrict it to affect only the products displayed under Random Products? Of course if the task in point 2 can be accomplished (is it with a cron task?) then there's no problem just need to draw the random products from the active category.

Thank you =)

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

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
7 years 5 months ago #255162

Hi,

2. 3. Then, yes, using a mass action to add the product to a category will be the best in that case.
You can do that with a mass action with a trigger like "every minute", a filter with your condition on the product_sale_end column like that: product_sale_end < {time}
and an action to add a category to the product.

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

  • Posts: 25
  • Thank you received: 2
7 years 5 months ago #256025

Hi nicolas,

I have set up the mass action as follows:

MASS ACTION 1
Data: Product
Product Triggers: Every days
Filters
1. Category columns - category_column = Billboard
2. Product columns - product_sale_end <= {time}
Actions
1. Update the categories - Remove - Billboard
2. Update the categories - Add - Past Goodies

MASS ACTION 2
Similar except product_sale_end = 0 and the Actions in reverse (Remove from Past Goodies, Add to Billboard) to move those without sale end date specified (value = 0) back to Billboard, and trigger set to Every minutes so that it activates once after Mass Action 1 is triggered

When I click Process in sequence (Mass Action 1, then Mass Action 2), it works OK. But it doesn't automatically process upon the time trigger. Which means I have to manually process the action, and that defeats the purpose of automating. Or did I miss out anything in setting up the Mass Actions?

Thank you =)

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

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
7 years 5 months ago #256049

Hi,

If the automatic trigger of the mass actions doesn't work, it's probably that you didn't setup properly the cron task.
Please follow this documentation:
www.hikashop.com/support/documentation/5...ashop-cron-task.html

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

  • Posts: 25
  • Thank you received: 2
7 years 5 months ago #256202

Hi Nicolas,

The Cron URL works: www.orz.com.sg/index.php?option=com_hikashop&ctrl=cron

I'm checking with the host provider as well.

You can see the screen grab of the Mass Action set up in the attachment - it's set to trigger everyday but it doesn't, did I set the Mass Action up incorrectly?

Thank you =)

Attachments:

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

Time to create page: 0.112 seconds
Powered by Kunena Forum