Inline styling

  • Posts: 127
  • Thank you received: 6
10 years 8 months ago #185271

-- url of the page with the problem -- : www.juicybike.co.uk
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.3

Hi
I seem to get an awful lot of in-line styling and script functions generated that does not seem needed, related to Hikashop modules and views.

I'm trying to get rid of as much irrelevant generated code as possible and would appreciate knowing where it's coming from and how to avoid it.
Some Hikashop Module styling code appears on pages where the module is not even being displayed.

Help appreciated!

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #185279

Hi,

To remove the css generated for the modules you have to do an override of the file "administrator/components/com_hikashop/helpers/module.php" and do a return at the top of the "setCSS()" function.

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

  • Posts: 127
  • Thank you received: 6
10 years 8 months ago #185396

Thanks Xavier
I can edit that file in Dreamweaver as I can't seem to find it through the backend to "override". Is this the best way or am I misunderstanding you? (what happens when I upgrade in the future...)

Also, how can I get rid of the inline functions:
<!--
window.hikashop.ready( function(){
var totIncrement = 0;
var increment = 300+1;
var maxRightIncrement = increment*(-2);

try{
var myEffect__122 = new Fx.Morph('product__122', {
duration: 1000,
link: 'cancel',
transition: Fx.Transitions.linear,
wait: true
});
}catch(err){
var fx__122 = new Fx.Style('product__122', 'margin-top', {
duration: 1000,
transition: Fx.Transitions.linear,
wait: true
});
}

that also get generated many times?

Thanks (and Happy New Year! by the way)
:)

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 8 months ago #185434

Hi,

If you want remove all the CSS generated by the system for the listings, you can add an entry in the table hikashop_config of your database via your phpmyadmin with the namekey no_css_header and the value 1.
Note that this means that the listings won't display normally unless you add CSS somewhere else to handle that.
That way, you won't loose the change when you update.

For that javascript, it comes from the carousel system.
If you want to remove them, you can edit the file "carousel" of the view "product" via the menu Display>Views and remove the line below at the bottom of the file:
$doc->addScriptDeclaration("\n<!--\n".$js."\n//-->\n");

Of course, this means that the carousels you have on your page won't work anymore since that inline javascript is generated out of the options that you select in the configuration of the carousels.

The following user(s) said Thank You: Bobwales

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

  • Posts: 127
  • Thank you received: 6
10 years 7 months ago #187606

Thanks Nicolas
I've made those changes and the site still runs ok with fewer in-line declarations of css and scripts.
Main concern now is that I get repeated canonical links in the source.
It seems that when I remove the canonical from the product information then that problem is solved. However all your advice states clearly that using canonicals is important - so I'm not certain my site is set up correctly.
Do you offer a check-up service, to see if I've set things up correctly?
An hour or two of expert time might save me many days of trial and error!
I'm keen to get this site honed better for seo and duplicate canonical links is a problem - Google will probably not index such pages...

I'm open to offers!
Thanks
Bob

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 7 months ago #187739

Hi,

It probably means that you have another extension adding the canonical URL on the page.
I indeed say that it is important to fill the caonical URL for your products, but if you have already another extension on your website in order to do that, then there is no need to do it in HikaShop. It's one or the other, not both.

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

  • Posts: 127
  • Thank you received: 6
10 years 6 months ago #193829

Hi Nicolas
I have no other components configured to generate canonicals for Hikashop products.

But when I set "Force canonical URLs on listings" to "Use Canonical if specified" two canonical links are generated on the product page.

Please take a look at one example for "Classic Click Bike":
www.juicybike.co.uk/electric-bikes/dutch...yle-electric-bicycle
The duplicated canonical links are produced at around line 15 and again at around line 652

Two products show the problem clearly: Classic Click (first product on the home page) and Sport Click (second on the home page).

The Classic Click Bike has its canonical specified and produces: /electric-bikes/dutch-style-electric-bikes/classic-click-dutch-style-electric-bicycle (but with two canonicals on the page).
The Sport Click Bike has no canonical and so its URL is generated producing: /component/hikashop/sport-click-our-latest-hybrid-ebike?Itemid=0 (but with only one canonical link on the page).

This quite perplexing!

I'd be grateful if you could show me where I'm going wrong - I've put in many many hours trying to solve, to get good SEFs and single canonical links.

Thanks in advance, Bob

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

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #193851

Hi,

You problem of having two canonical urls, come certainly from your Joomla config which generate canonical urls, so you have to disable Joomla SEF plugin.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum