Word-wrap in cart module.

  • Posts: 13
  • Thank you received: 0
11 years 7 months ago #96078

Hello,

My problem is that I have to put products with very long names in cart, but when word is longer than, I don't know 6 chars, it stretches the cart outside the page.

Like in example, part 10_MITTELDRUCKFILTER is to long.
But part 60_RUCKLAUFF.. don't stretch cart, because I putted SPACE in the middle of the word, when I added this product in product list.

So where I have to add CSS to wrap that long words?

Last edit: 11 years 7 months ago by kapis555.

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

  • Posts: 2334
  • Thank you received: 403
11 years 7 months ago #96118

Hi there,

Is it in the cart or the minicart?
Just give us a link to your page so we'll tell you with div you have to edit.
Also, you can try it by yourself, you just have to right click on the given zone, user "inspect element" (available in opera, chrome, firefox...) and see the name of the div.
You'll then just have to change the with and it should works fine :)

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

  • Posts: 13
  • Thank you received: 0
11 years 7 months ago #96261

i-neuson.com/index.php/katalogs/ch-1200/rezerves-dalas

You have to login to see cart login: kaspars
pasw: traks
I added some CSS to div's but no change.

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

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

Hi,

Thanks to try to set a fixed width to the class ".hikashop_cart_module_product_name_value{ ... }".
Else you can try to edit the view "product / cart".

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

  • Posts: 13
  • Thank you received: 0
11 years 7 months ago #96343

Hi Xavier,

Thanks for replay, I tried your solution, but no effect.

I even tried ".hikashop_cart_module_product_name_value a { ... }".



You told something about "product / cart", what I have to change there?

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

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

To wrap the word, you can edit the view "product / cart" and replace the line :

<?php echo $row->product_name; ?>
By a php function to change the value of $row->product_name.
Something like:
<?php $productName = wordwrap($row->product_name, 20, "<br />\n"); echo $productName; ?>

You can change "20" to the number of letters desired.

Here is the doc for the wordwrap function:
php.net/manual/en/function.wordwrap.php

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

  • Posts: 13
  • Thank you received: 0
11 years 7 months ago #98117

Thanks, Xavier!

Line that worked for me was

<?php $productName = wordwrap($row->product_name, 14, "-\n", true); echo $productName; ?>


BUT, I have extra question. When I'm removing product from cart, after 3rd removed product page is redirected to Checkout, why does that happen?

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

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

Hi,

Have you set an url for the option "url where to redirect when the cart is empty" in Config > Main > Cart ?
Is the 3rd product the last one which was present in the cart ?

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

Time to create page: 0.073 seconds
Powered by Kunena Forum