Refund item price to include order tag value

Hi again everyone, here on v3 once more, this time with a refund item question.

I followed a previous example I found by emre to refund the value of an item by creating an Update Order action and setting the price parameter to [=0-Order.Price], however this doesn’t seem to take into account order tag prices (for example, refunding an a $10 pizza with a $1 topping still only refunds -$10).

I imagine its a simple change of syntax in the parameter to include order tags, but I can’t find a reference on what to change it to.

You may be limited with what you can do with v3 in this regard. I am not familiar with the expressions possible in v3.

You may find more resources at www.sambapos.org as this forum is for v4 and in the very near future v5.

PS. yes www.sambapos.org seems not very active… you will also find v3 support in this forum is about the same. Most people have moved on to the newer versions to enjoy the enhanced features.

@ryanjgillies Does V3 have the option to include order tag prices into main product price instead of listing seperately? (This would be an option when setting up/editing order tags if it is even there in V3)

So you would have:
Pizza $11
Topping

Instead of:
Pizza $10
Topping $1

Not ideal if you want to list order tags with their prices seperately, but its a way round your issue of refunds if V3 has the option

Like @Jesse said were testing V5 at the moment and a lot of people like us on here have actually never used V3 so our help is very limited. If my suggestion above isnt possible my only other is to find a way to upgrade to V4 and then V5 when released :slight_smile:

I’m hoping that whatever syntax will work in v4 will also work in v3 - if I’m not mistaken the tutorial emre posted regarding refunding orders was in relation to v4 and it was evidently backwards compatible. If I can learn what other parameters are available in v4 I might be able to apply them in my situation.

As for using choice of version, until I can get a full translation ability on v4 or v5 reaches a stable release and I can write a translation for it, I have to stick with v3.

Not necessarily, as there are many expressions, formats, tags etc etc that were created in V4 that do not exist in V3 so whilst there may be some things that work in V3 that were created in V4, thats because those functions exist in V3. V4 doesnt have backwards compatability, if something in V4 doesnt exist in V3 then it will not work

V5 is stable and some are using it in a live environment, we had the last beta upload yesterday so were just testing that to make sure its ok then emre is looking to release it

V4 does have backwards compatibility. BC means V3 features will work with V4. It does not mean V4 features will work for V3.

Hi @RickH, understandably not all features in v4 will be in v3, that’s the nature of development.

My point more was that [Order.Price] was already in v3, so if there is a list of variables that can be used, I can check to see if the applicable parameter exists and try it in v3 to see if it existed in that version or not.

Does anyone know if/where such a list exists?

You can review V3 documentation & forum to see what works for V3. Things we’re talking in this forum are for V4 and most probably will not work for V3.

1 Like

Thats what i meant :slight_smile:

1 Like

So after a lot of rummaging around the old documentation I found the following article on applying discounts: http://sambapos.org/wiki/doku.php/en/adding_discounts_to_orders_with_order_tags

Order.Model.GetVisiblePrice() appears to be what I’m looking for: Visible Price apparently means “the price of the product plus other order tag amounts.”

But when I apply this variable in either emre’s refund method, or adjust the aforementioned discount method to use [=0-(Order.Model.GetVisiblePrice()*2)] instead, the end result is the same - only the order item itself is refunded, not the additional value of any tags.

Is this a bug that was identified and solved in v4, or am I missing something?

That seems to be specifically just for price has nothing to do with refunding the item. But again we are discussing v4 in this forum. V3 support is limited to the v3 forum and website.

Even if that was a bug it would get no development support, you would have to debug the source yourself to fix it. It appears to me that it’s not a bug and your trying to do something that very well may not be possible due to v3 expression limitations.

V4 changed how expressions were used entirely. Its likely most of the expressions you see in v4 will not work with v3.

I appreciate that these forums are intended for v4 and v5, but just a quick glance at the v3 forums will instantly reveal that the community for that version is extremely inactive, if not dead.

I ask here because v3 is at least a precursor to v4 and undoubtedly still shares a great many features - emre’s tutorial on refund buttons is based on v4 but as stated by him should work in v3, and I’m hopeful that there must be some members of the community here that still have a faint memory of v3.

I’m hoping someone may have a recollection of GetVisiblePrice() and how it was intended to be implemented - if indeed it is a bug preventing it from working as intended then I know I need to debug v3. If I’m just using it incorrectly then perhaps someone can enlighten me. If its an expression limitation I’ll have to start looking for an alternative.

V3 forums are dead mostly because the majority have moved on to v4 and soon v5. That sort of syntax for expressions is not used in v4 anymore due to a much simpler system that was implemented and improved even further with v5.

in v4 for example the syntax is simply {PRICE} and {TOTAL PRICE} however there are actions in v4 not available in v3 that allows refund automation without expressions.

I highly doubt you will find this help here. I mean statistically just look at how many v3 questions come up and the answers are mostly the same… upgrade to v4 or look through v3 documentation and forum. While @emre could answer these questions he has to draw the line somewhere if he answers v3 questions then it takes time away from actively developed software which is now v5. V3 is in the past we have moved on to v5.

Of course I understand that priority for emre and the team needs to be on v4 support and v5 development, and whilst I’m not expecting a response from him or anyone else, posting here is my best bet at getting an answer.

Had v4 have had internationalisation support then I wouldn’t have had this issue, but as it stands v3 is more appropriate for my scenario, so I’m stuck hoping someone might know!

The final piece of the puzzle has fallen into place, it was quite simple in the end!

If anyone else struggles with this, ensure that any order tags you use with additional prices have the setting “Add Tag Price To Order Price” as true.

I originally had the prices listed separately in order to let customers know what they were paying for each extra, but that was what prevented Order.Model.GetVisiblePrice() from functioning as expected.

RickH mentioned this as the 2nd reply to your thread you must have missed it :stuck_out_tongue:

1 Like

So he did! Somehow I misread that as rolling them up into a ticket tag, not an order tag! As they say in the UK; should’ve gone to specsavers, ha.