- Posts: 11
- Thank you received: 0
product display page (listing tabel view)
* @version 2.3.1
Hi,
Working with a product listing table i encountered a problem.
Because we are working with products with prices in relation to bulk prices per piece, i want to show the bulk prices in a tabel view.
On the forum i found a (almost) solution for my problem, but it is still not working as it should.
Enclosed is a pict. from the generated view including php code and VAR_dump. As you probably will see, i need some help.
The solution i found was from Xavier :
$prodClass = hikashop_get('class.product');
$prodClass->getProducts($this->row->product_id);
echo $this->currencyHelper->format(@$prodClass->products[1]->prices[0]->price_value,4);
echo '</td><td>';
echo $this->currencyHelper->format(@$prodClass->products[1]->prices[1]->price_value,4);
But the result is still (value of 0) for secondary prices (bulk prices).
If i change (see pict) prices[1] to prices[250] it will give the correct number, otherwise the value is 0.
The thing is, that not every product has the same bulk prices!
Product (a), size (10x10x10) list price (10), per 50(7), per 100(5)
product (b), size (10x15x10) list price (15), per 25(10), per 50(
in my example (pict) the price per 15 and 25 are not in the list.
Any advise is welcome.
Richard
Please Log in or Create an account to join the conversation.
So what need to be done is something like:
This way if the price exist, it is displayed, else not.
Please Log in or Create an account to join the conversation.
I tried your solution and it (partly) worked. (See enclosed pict 001) The problem is that a number of products have different bulk amounts.
example:
product a : 1, 250, 500, 1000, 3200
product a1: 1, 100, 250, 500,1000, 2400
product b: 1, 6, 12, 18, 24
product c: 1, 36, 72, 180, 288
In other words, I can only place a max of 9 (th) header/bulk amounts in the view and therefore i can't show all bulk prices! See enclosed pict 002.
I therefore have the following question:
a) Is it possible to make different headers in the table list view, based upon for instance a product-range? Like Code 100.005 to 100.130 (bulk-range) header001, 100.140 to 100.235 (bulk-range) header002 etc. In this case, working with 1 table list view will give a lot of possibilities.
Thanks in advanced
Richard
Please Log in or Create an account to join the conversation.
So you should not use hard coded values but you have to list the keys in "row->prices" to get all values of all products in the current listing.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Thanks for the reply.
I'm currently using the following code for the view:
Thanks,
Please Log in or Create an account to join the conversation.
You can use a more dynamic algorithm. It requires some development/PHP skills.
You have to fill the array in the view you can access to all rows.
So you can extra all array keys from the $rows[...]->prices
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
The dynamic algorithm is a better approach for this problem, but i'm still stuck with the table header (theader) where
The table header equals the price_min_quantity. For now I use a fixed header f.i. 1, 50, 100, 150, 250, 500, 1000, 2400, 3200 like
price_product_id price_min_quantity Price_value
25 1 0,43
25 250 0,31
25 500 0,25
.. ........... ............etc.
Brings me to my problem. In case of example B, the table header is still 1, 50, 100, 150, 250, 500, 1000, 2400, 3200 but the values of price_min_quantity are:
Example: B
price_product_id price_min_quantity Price_value
64 1 1,43
64 6 1,31
64 12 1,25
.. ........... ............etc.
You can see my problem here. Perhaps there is a possibility to make the <th text variable or in relation to price_product_id?
Example:
Hope you can help me. Done excellent so far.
Regards,
Please Log in or Create an account to join the conversation.
For the header part, you can use:
Please Log in or Create an account to join the conversation.
With your solution i'm getting on the right track, but I still encountered a problem in the view.
Source:
In this case there are no headers! Only corresponding values.
Just to check, i used the following code:
That gave the following results: LIST VIEW-B.jpg
In this case i can see all headers from the array, even when there is no value.
I'm confused and on the other hand convinced to leave it to the pro's
So if you could give me the final push, i would be very obliged.
Regards,
Please Log in or Create an account to join the conversation.
Sorry my code was not correct, the values were not loaded.
Thanks to add:
And use:
For the header part.
And:
Please Log in or Create an account to join the conversation.
I just tried the solution you gave, with the following results: See pict
Perhaps the complete code will give you an idea what i did?
Regards,
Please Log in or Create an account to join the conversation.
Thanks to try that code:
If still not working thanks to give me backend access via pm in order to take more time about this.
thanks to give the url to that topic in the private message.
Please Log in or Create an account to join the conversation.
Thanks for the update. It 'almost' works perfectly.
I've enclosed a pict of the latest results.
As you can see, for some reason the header is 'mixed up'. The first header-value (e.g. 250) is not placed on the same row as the rest of the header. The corresponding value (0,31) is now underneath the header 500 instead of 250.
Too make sure i didn't make any typo's i enclosed the code.
I'm sorry to say that there is no back-end at this moment. Where still on a local development situation, so this is the only way to make any changes at the moment.
Last minute change: I've changed the source regarding to the header and that seems to work. Rest sorting the header/data.
As for the view, is it possible to sort the header / data on low header-value to high header-value. In that case the view would look better.
As always i'm very grateful for the good professional support.
Regards,
Please Log in or Create an account to join the conversation.
Indeed the "<th>" tags were not at the correct place.
Thanks to add:
Please Log in or Create an account to join the conversation.
All is working fine. Thanks for the support
Regards,
Please Log in or Create an account to join the conversation.
Table header:
photo of NO; product Name; Price / piece; price> 10 items; price> 50 items; price> 100
There where price 0, then "Call of price"
How can solve
Thank you!
Please Log in or Create an account to join the conversation.
Sort but I don't really understand your issue, could you please give us more details ?
Through screenshots, or something else ?
Please Log in or Create an account to join the conversation.
I would like to:
column headings: Column 1: Product name; Column 2: Price 1; Column 3: Price 2; Column 4: Price 3; Column 5: Price 4; Column 6: Cart button
no photo
Please Log in or Create an account to join the conversation.
So you have to edit the view "product / listing_table" and do the same editions than RWouters.
With these modifications columns had been added with the desired values.
then you just have to reorder the fields as you want, it's some HTML.
Please Log in or Create an account to join the conversation.