Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Attributes formatting

Locked

Started by andyase on 26 Aug 2006, 9:10 PM · Views: 1,747

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
26 Aug 2006, 9:10 PM
#1
andyase avatar

andyase

Zen Follower

Join Date:
Oct 2005
Posts:
102
Plugin Contributions:
0

Attributes formatting

Hello
I need to create some attributes and then format the output!

I can create the attributes ok, I need to create text attributes and format the end result so that when the user goes to checkout the text output from the attributes selections are neat and tidy! what file/s would i ned to tweak to get the results tidy?
example: I make an text attribute called "name" when the user fills in the box NAME [ Fred Flinstone] the resulting text on the order shows NAME: Fred Flintstone.
I would like it to show, Fred Flintstone (without "name") is this possible?

Cheers
Andy

28 Aug 2006, 11:41 AM
#2
andyase avatar

andyase

Zen Follower

Join Date:
Oct 2005
Posts:
102
Plugin Contributions:
0

Re: Attributes formatting

I have been looking through the wiki and found that one of the pages i need to change the look of is "Shopping_cart"

Does any one know which file inputs "text attributes" into shopping_cart?
I need to change the format of the text attributes being put into shopping_cart.

ie: I make option name=name type=radio (selected) value=fred

In the shopping_cart I get - name - fred

What page can i edit to get just "fred" in shopping_cart, I also need this in the (backoffice customers, orders) as well!!!

Can any :smartass: advise please
Andy

30 Aug 2006, 1:02 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attributes formatting

To use Attributes for every name would not be adviseable ...

You would be better off using an Option Name such as Name with the Option Type of TEXT ...

Then add that to your Product as:
Option Name: Name
Option Type: TEXT
Mark it as Required if needed ... to force a choice

Trying to make attributes manage 100s of names and customers attempt to pick one is really too difficult ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Aug 2006, 5:32 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attributes formatting

NOTE: There are two methods of Text attributes ...

On the Option Names Manager ...

Setup the Option Names for text input such as:
Option Name: First Name
Option Type: TEXT
Sort Order: 10

Option Name: Second Name
Option Type: TEXT
Sort Order: 20

etc. etc.

If you need one of these to be more or less a note or letter ... AFTER you create it in the method above, Edit it ...

There are additional options when you Edit to set:
Rows, Display Size and Max Length are for Text Attributes Only:

These would let you set a TEXT input to a TEXTAREA so that you could make it, for example, 10 Rows high and allow 500 characters ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Aug 2006, 6:43 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attributes formatting

That is in your stylesheet ... you might post an URL to that product and someone can look at what needs changing ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Aug 2006, 8:08 PM
#7
andyase avatar

andyase

Zen Follower

Join Date:
Oct 2005
Posts:
102
Plugin Contributions:
0

Re: Attributes formatting

OK
I have been working on this all day and have worked it out (i think).

If anyone wishes to remove bullets, option names and hyphens from the shopping_cart and back office order check below, ps: i did not remove them from invoices and packing slips, if you need to do that youll need to investigate a little.

This fix works ok for me, I'm no expert, if you want to use it thats great but it would be good for an expert to look at it first :lookaroun .

here is what i did.

To remove bullets hyphens and title (option name) from text attributes.

If you remove the bullets (<li> "list item" ) the list format will be lost so replace it with a transparent image.

Create a new class in (your_template/css/stylesheet .css) file using a 1x1 transparent image to replace the standard bullet.

.bully {
list-style-position: inside;
list-style-image: url(http://yourdomain.com/images/bully.gif%29;
}


INCLUDES/TEMPLATES/YOUR_TEMPLATE/TEMPLATES/tpl_shopping_cart_default.php

Line:98

CHANGE:

<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>

TO:

<li class="bully"><?php echo $value[''] . nl2br($value['products_options_values_name']); ?></li>

INCLUDES/TEMPLATES/YOUR_TEMPLATE/TEMPLATES/tpl_checkout_confirmation_default.php

Line:131

CHANGE:
<li><?php echo $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']); ?></li>

TO:
<li class="bully"><?php echo $order->products[$i]['attributes'][$j][''] . '' . nl2br($order->products[$i]['attributes'][$j]['value']); ?></li>

ADMIN/orders.php ( for some reason the override won't work on this file ie: admin/your_template orders.php, so rename the original and make a copy somewhere and also

keep a copy of your changed file as well in case of upgrades)

Line:414

CHANGE:
echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);

TO:
echo '<br /><nobr><small>' . $order->products[$i]['attributes'][$j][''] . '' . nl2br($order->products[$i]['attributes'][$j]['value']);

As i said im no expert so treat this as a :beta:

Andy