Attributes in Zen cart [closed] - php

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I was working with attributes in Zen cart and looking for the way to insert quantity for each product options, like I have a product called "Levis T-Shirt" and its having attributes like, "Color" & "Size", now i want to insert something like:
Levis T-shirt - Red Color - Large - Quantity 10
Levis T-shirt - Black Color - Medium - Quantity 15
Levis T-shirt - Blue Color - Large - Quantity 05
So how could I insert like this?
Note: All this functionality is from admin at the time of saving products to DB
Thanks,
In advance

this add-ons may help you.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=310
Not tested.0

Related

Display an icon for each number of bedrooms (property website) php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a property website.
At the moment, on the listing, and in search results, it says Number of bedrooms: [pulls the number from the database]. It uses an array variable, $a1[rooms].
Instead, I want to display a small icon of a bed for the number of bedrooms. So if three bedrooms then it should say, Number of bedrooms: [bed img] [bed img] [bed img]. [bed img] of course being a small icon/image of a bed.
So whether there are 1 bedrooms or 5 bedrooms, this is the number of times I want the icon displayed. The number of bedrooms is stored here: $a1[rooms].
Fairly simple really.
Thanks in advance.
Something like this will do the trick:
for ($bed_counter = 1; $bed_counter <= $a1['rooms']; $bed_counter++) {
print '<img src="bed.jpg">';
}

Store area unit conversion in mysql table [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have land buy/sell related website. So I want to store land area units in India and their conversion in other in units in mysql table. When user from specific area see properties list on website and if he selects acre in dropdown list then he can see the every property area in the acre though the property was listed in another unit.
So How Do I do this??
A simple two table can do this .. if you like..
Table 1:Units[id,UnitName]
Table 2:ConversionUnit[conversionId,fromUnitId,toUnitId,offset]
such as
table 1: [1,Centimetre],[2,Mitre],[3,kilometre]
table 2: [1,1,2,100],[1,3,1,0.000001]
First entry in the table to for converting CM to M and second row is to convert from KM to CM.
Hope it helps..

I want to create a currency table for my project [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Sorry for grammar mistakes. I want to create a currency table for my project which will use for adding currencies of different countries. This is my currency table but I'm confuse that this will good or not for project, so should I delete or add more columns in this table? Please help me.
currency
id | symbol | description | country | date_added | date_updated
I believe you better should have two tables.
One table for currency descriptions with fields id, symbol, description, country and other table related to this for daily currency rates with fields currency_id, rate, time_updated.
The question is if you really need the date_added. I think this is a information which is not really required.
If you want to update it regulary, I would implement a column "rate", which gives you the value in comparison of Euro or US$ as example. This way people can get a better impression how much 1 Unit of the currency is worth.
Otherwise this looks to be quite okay.

Create Query on PHP [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a variable $z_name=carredwidetastymodern...; (here I show just a part of string "opelmazdabmwhynday..." (in fact, it's a very long string)
I would like fill in ref field from $z_name, could anybody help me?
id name ref id name ref
10 opel 10 opel car
11 apple 11 apple red
12 river 12 river wide
13 food 13 food tasty
14 pc 14 pc modern
(here I show just a part of table. It's a very big table, a lot of records)
Use loop by all records and add inside
mysql_query("UPDATE table_name SET ref = '$z_name' WHERE id =$id");
Well, maybe I'm missing something... I would say that
"REPLACE INTO table_name SET ref = '" . $z_name . "'";

Calculate stars from grades(5-1 and 1-5) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have grades from 1 to 5 where 1 is the best and 5 is the worst(But not just integral numbers like 1, also 1.14 and so on).
I want to calculate how many stars each grade would be(5 stars would be the best, 1 star the worst - 3 would stay 3 of course - but the rest?)
I googled to get the result but I'm not finding anything helpful. Maybe I'm missing the forest for the trees, I don't know. Basically it would be the reverse number I guess?
I want to do that in PHP.
Pretty straightforward I would think:
$new_grade = 6 - $old_grade;
Or for a more generic solution:
$new_grade = $grade_max + $grade_min - $old_grade;
Star = 6 - Grade
So:
5 → 1
4 → 2
3 → 3
2 → 4
1 → 5

Categories