Still on XH_Shop

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
milkodb
Posts: 43
Joined: Sun Jun 23, 2013 11:00 pm
Location: Italy

Still on XH_Shop

Post by milkodb » Mon Aug 19, 2019 3:39 pm

Hi Christoph and all who can give me an answer,
sorry if I continue to bother you with things that may seem trivial, but my ability to understand the code is rather elementary, after all I'm a graphic designer and not an expert programmer ...
Here is my need: I have to manage book stores where it is not important that the product is sold out because it can be reprinted upon customer's request against a minimum of requested copies (today with digital printing it is feasible). Using Wellrad I solved the problem by modifying the code without any particular difficulty. Now with XH_Shop I have managed to make sure that even a book classified as "not available" is shown in the catalog anyway and so far so good. What I had done previously was to create a condition for which if the product was not available it was shown in the catalog but not its block containing the elements for the order and a label was shown showing the book as " out of print but can be reprinted upon direct request via email ", etc. I thought I was using the same method used with Wellrad using "$ product ['isAvailable'] == false" to establish the condition. Unfortunately for my ineptitude neither this value nor ['stockOnHand'} are available in Catalog.php as they were in Wellrad and I can't find the way to retrieve the value of the condition "if available" in any way.
If you were so kind and helpful as to suggest me how to do it I would be grateful and at this point I think I should at least have a truck of beer ... :)

A couple of suggestions, even if for me it would not be big problems because I don't think it is difficult to do it alone, but I dare presumptuously to propose it if it can serve to improve the functionality of XH_Shop: when you make an order, the cart contains the elements ordered and all the mechanism proceeds correctly to allow the order to be paid. A button would be useful to allow the customer to delete items from the order before arriving at the conclusion and one that would allow the order to be canceled (or to cancel the order simply if all the items in the order were removed). Currently the only way I have found is to clear the browser cache and start over. Clearly it is not something understandable for any user.
Another observation concerns the fact that if you search for an article by entering data in the search field, there is no way to go back to the complete catalog list without selecting a category and then again "all categories", or by changing the page of the site and then returning to the store.
These are small suggestions, but they seem useful to make the store really "foolproof". And I as a "fool" am a great β tester ... :D

Thanks, really thanks.
Milko

frase
Posts: 2955
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Still on XH_Shop

Post by frase » Mon Aug 19, 2019 4:44 pm

Hi, it's me again. :D
milkodb wrote:
Mon Aug 19, 2019 3:39 pm
Unfortunately for my ineptitude neither this value nor ['stockOnHand'} are available in Catalog.php ...
You didn't check that right, or you got the wrong version. This value exists.
In the catalog.php every article has that:

Code: Select all

$products['xxxxxxxxxxxx']['stock_on_hand'] = 1; // or 0
milkodb wrote:
Mon Aug 19, 2019 3:39 pm
when you make an order, the cart contains the elements ordered and all the mechanism proceeds correctly to allow the order to be paid. A button would be useful to allow the customer to delete items from the order before arriving at the conclusion and one that would allow the order to be canceled (or to cancel the order simply if all the items in the order were removed). Currently the only way I have found is to clear the browser cache and start over. Clearly it is not something understandable for any user.
cart-delete-button.png
This function is also available (see figure).
Always in the first step of the payment process.
You can return to this step at any time.
milkodb wrote:
Mon Aug 19, 2019 3:39 pm
Another observation concerns the fact that if you search for an article by entering data in the search field, there is no way to go back to the complete catalog list without selecting a category and then again "all categories", or by changing the page of the site and then returning to the store.
I'll say. That's actually a little inconvenience. You're right.
milkodb wrote:
Mon Aug 19, 2019 3:39 pm
These are small suggestions, but they seem useful to make the store really "foolproof". And I as a "fool" am a great β tester ... :D
We need people like that! :P

Do you know the XH-Shop Wiki?
You do not have the required permissions to view the files attached to this post.

frase
Posts: 2955
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Still on XH_Shop

Post by frase » Mon Aug 19, 2019 5:59 pm

Ahhhh, that reminds me that you have taken over/converted old articles from the Wellrad. Of course 'stock_on_hand' could be missing there.
You might have to save each article at least once to fix it. (I don't know exactly :( )

milkodb
Posts: 43
Joined: Sun Jun 23, 2013 11:00 pm
Location: Italy

Re: Still on XH_Shop

Post by milkodb » Mon Aug 19, 2019 7:23 pm

Yes, I know it exists. :D And no, "stockOnHand" continues to be present even after conversion. It is the only value always declared as numeric instead of a string and not an array. But in any way you try to recall it there is no answer.
It is clearly written in catalog.php as "stockOnHand". But if I try to call it in the "<? Php" foreach loop ($ this-> products as $ index => $ product) etc. in catalog.tpl, it is not recognized as an absolute value ("1" / "0" or 1/0) neither as a Boolean situation (true / false), nor as a simple print of the value nor even as a check in an "if" loop. So either I am not using the correct syntax to call it (but it is the same one that calls "name" and "teaser"), or something is not working and I don't know why. Not even trying to call the boolean on "isAvailable" ... :)
Milko

milkodb
Posts: 43
Joined: Sun Jun 23, 2013 11:00 pm
Location: Italy

Re: Still on XH_Shop

Post by milkodb » Mon Aug 19, 2019 7:36 pm

Ah, ok. I've seen "delete article" button (x). Ok, I'm blind, this is why I play the fingerpickin blues well... :)
I enlarge it a bit with CSS, thanks...
Milko

frase
Posts: 2955
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Still on XH_Shop

Post by frase » Mon Aug 19, 2019 8:02 pm

milkodb wrote:
Mon Aug 19, 2019 7:23 pm
But if I try to call it in the "<? Php" foreach loop ($ this-> products as $ index => $ product) etc. in catalog.tpl, it is not recognized as an absolute value ("1" / "0" or 1/0) neither as a Boolean situation (true / false), nor as a simple print of the value nor even as a check in an "if" loop. So either I am not using the correct syntax to call it (but it is the same one that calls "name" and "teaser"), or something is not working and I don't know why. Not even trying to call the boolean on "isAvailable" ... :)
I suspect that articles with "stock-on-hand=0" do not arrive at all in the catalog.tpl or are available.
Probably everything happens in the Product.php.
You will have to wait for Christoph again. :cry:

cmb
Posts: 13273
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Still on XH_Shop

Post by cmb » Sat Aug 31, 2019 10:37 am

milkodb wrote:
Mon Aug 19, 2019 7:23 pm
It is clearly written in catalog.php as "stockOnHand". But if I try to call it in the "<? Php" foreach loop ($ this-> products as $ index => $ product) etc. in catalog.tpl, it is not recognized as an absolute value ("1" / "0" or 1/0) neither as a Boolean situation (true / false), nor as a simple print of the value nor even as a check in an "if" loop. So either I am not using the correct syntax to call it (but it is the same one that calls "name" and "teaser"), or something is not working and I don't know why. Not even trying to call the boolean on "isAvailable" ... :)
Well, $product['isAvailable'] is supposed to be available in the foreach loop in catalog.tpl. For instance, you could insert after this line:

Code: Select all

<?php if (!$product['isAvailable']):?>
		<div>needs reprint</div>
<?php endif?>
Christoph M. Becker – Plugins for CMSimple_XH

milkodb
Posts: 43
Joined: Sun Jun 23, 2013 11:00 pm
Location: Italy

Re: Still on XH_Shop

Post by milkodb » Wed Sep 11, 2019 1:36 pm

Ok Christoph, thanks a lot, it's allright.

I'm were wrong in commenting code to show the product also when non available in "Product.php", so product data array was distorted. Now I get this eliminating //if ($collectAll === false && $product->isAvailable() === false), ecc. in "Controller.php" and all is right.

If there's somethig you think is better, please tell me.

For now, thank for your patience. :)
Milko

Post Reply