- Posts: 13
- Thank you received: 0
Word-wrap in cart module.
13 years 7 months ago - 13 years 7 months ago #96078
by kapis555
Word-wrap in cart module. was created by kapis555
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?
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: 13 years 7 months ago by kapis555.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #96118
by Eliot
Replied by Eliot on topic Word-wrap in cart module.
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
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.
13 years 7 months ago #96261
by kapis555
Replied by kapis555 on topic Word-wrap in cart module.
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.
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.
13 years 7 months ago #96316
by Xavier
Replied by Xavier on topic Word-wrap in cart module.
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".
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.
13 years 7 months ago #96343
by kapis555
Replied by kapis555 on topic Word-wrap in cart module.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #96439
by Xavier
Replied by Xavier on topic Word-wrap in cart module.
To wrap the word, you can edit the view "product / cart" and replace the line :
By a php function to change the value of $row->product_name.
Something like:
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
Code:
<?php echo $row->product_name; ?>
Something like:
Code:
<?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.
13 years 7 months ago #98117
by kapis555
Replied by kapis555 on topic Word-wrap in cart module.
Thanks, Xavier!
Line that worked for me was
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?
Line that worked for me was
Code:
<?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.
13 years 7 months ago #98184
by Xavier
Replied by Xavier on topic Word-wrap in cart module.
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 ?
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.064 seconds