questions after update of hikashop

  • Posts: 490
  • Thank you received: 2
2 years 8 months ago #335255

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9
-- PHP version -- : 7.2
-- Error-message(debug-mod must be tuned on) -- : none

hi

after updating hikashop to the latest version
the main product page was gone. after inspection the issue is with

hk-row-fluid the css is as follows

display: -webkit-box;
    display: -moz-box;
    display: box;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-flow: row wrap;
    -moz-flex-flow: row wrap;
    flex-flow: row wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    text-rendering: optimizespeed;

i change it to this
.hk-row-fluid {
    display: block !important;
}

i feel that my changes was not appropriate.

i also inspected the code for
Original product / show_default.php and Override product / show_default.php
i can see that there are a lot of changes. So this is the second question. Are the updates not taking effect due to my overrides? i am having a lot of errors from google and was thinking it has something to do with my modifications and the update not taking effect.

so i need help on
1. is my css modification correct?
2. what should i do so that the updates will all take effect? Does the update take effect on a view if overrides are present? should i remove my overrides and move it to the new view?

thanks

Attachments:

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

  • Posts: 81625
  • Thank you received: 13085
  • MODERATOR
2 years 8 months ago #335260

Hi,

1. Well, the CSS modification you had to do is linked with previous CSS you have in that style_custom.css file.
By default, the "styles for the frontend" setting is empty. So when you edit that CSS to add your own CSS, you should start from a blank file. It seems that you have in there a lot of positionning CSS, which should not be there as the positioning is handled by the main hikashop.css file that can't be overridden.
So I don't think your view override has anything to do with it.
I think you must have copied the CSS of HikaShop from an old version (the 3.2.0) in that style_custom.css file and then modified the CSS you wanted to modify in there so that your CSS would override the default CSS of HikaShop.
That's a dirty way of doing it.
A cleaner way would be to only add in there the CSS code you need to override the default CSS of HikaShop. That would be easier to manage in the long run and cause less issue when we change things.

2. Regarding view overrides:
If you have a view override, it means that HikaShop will update the original view file on each update, but won't use it, as it will use your override file instead.
When you create an override view file in HikaShop, it will copy the code of the current version of the original view file in your override. Which means that all the modifications we'll add to the view file in the future won't be added to your override.
A clean way to do overrides is to delete the whole code in the override, and instead add such code:

<?php 
ob_start();
$this->AAA = 'BBB';
include_once('XXXX');
$html  = ob_get_clean();
str_replace('YYY', 'ZZZ', $html);
echo $html;

That way, you will use the original view file (with the path XXXX that you need to replace in the sample code above) so you'll get the modifications we make in the future, and you can modify the variables used by the original view file before the include_once, and you can change the generated HTML by the originale view file.

The problem is that doing things like this requires to know PHP as replacing variables and HTML like that will often require more complex coding that just the two lines I've added there as an example... So a simpler method is to replace the HTML/PHP in the copy of the whole code (like you already did) but properly mark your changes so that when we release a new version of HikaShop with significant changes to the view file, you can get your modifications, delete the override and redo it on the new version of the original view file.

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

Time to create page: 0.097 seconds
Powered by Kunena Forum