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 ...
Thanks, really thanks.
Still on XH_Shop
Re: Still on XH_Shop
Hi, it's me again.
In the catalog.php every article has that:
Always in the first step of the payment process.
You can return to this step at any time.
Do you know the XH-Shop Wiki?
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
This function is also available (see figure).milkodb wrote: ↑Mon Aug 19, 2019 3:39 pmwhen 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.
Always in the first step of the payment process.
You can return to this step at any time.
I'll say. That's actually a little inconvenience. You're right.milkodb wrote: ↑Mon Aug 19, 2019 3:39 pmAnother 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.
We need people like that!
Do you know the XH-Shop Wiki?
You do not have the required permissions to view the files attached to this post.
Re: Still on XH_Shop
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 )
You might have to save each article at least once to fix it. (I don't know exactly )
Re: Still on XH_Shop
Yes, I know it exists. 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" ...
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
Re: Still on XH_Shop
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...
I enlarge it a bit with CSS, thanks...
Milko
Re: Still on XH_Shop
I suspect that articles with "stock-on-hand=0" do not arrive at all in the catalog.tpl or are available.milkodb wrote: ↑Mon Aug 19, 2019 7:23 pmBut 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" ...
Probably everything happens in the Product.php.
You will have to wait for Christoph again.
Re: Still on XH_Shop
Well, $product['isAvailable'] is supposed to be available in the foreach loop in catalog.tpl. For instance, you could insert after this line:milkodb wrote: ↑Mon Aug 19, 2019 7:23 pmIt 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" ...
Code: Select all
<?php if (!$product['isAvailable']):?>
<div>needs reprint</div>
<?php endif?>
Christoph M. Becker – Plugins for CMSimple_XH
Re: Still on XH_Shop
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.
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