Skip to content

Instantly share code, notes, and snippets.

@steveosoule
steveosoule / 00-miva-check-if-a-customer-has-subscriptions-for-the-current-product.xml
Last active September 22, 2021 15:40
Miva - Check if a Customer Has Subscriptions for the Current Product
<mvt:comment>
|
| Configure Query
|
</mvt:comment>
<mvt:assign name="l.query:product_id" value="l.settings:product:id" />
<mvt:assign name="l.query:customer_id" value="g.Basket:cust_id" />
<mvt:assign name="l.query:offset" value="0" />
<mvt:assign name="l.query:max" value="10" />
<mvt:assign name="l.query:sort_by" value="'id_desc'" /><mvt:comment><!-- Available Options: id_desc, name_asc, name_desc, code_asc, code_desc, total_asc, total_desc, firstdate_asc, firstdate_desc, lastdate_asc, lastdate_desc, nextdate_asc, nextdate_desc, payment_asc, payment_desc, shipping_asc, shipping_desc, termrem_asc, termrem_desc, termproc_asc, termproc_desc --></mvt:comment>
@steveosoule
steveosoule / 00-miva-retail-base-price-price-subtotal-comprehensive.md
Last active September 17, 2021 20:44
Miva - retail, base_price, price, subtotal, & comprehensive

Miva - retail, base_price, price, subtotal, & comprehensive

The following notes & examples attempt to outline & define some common product prices as their affected by Price Groups and Basket options & quantities

Price Group Variations

  • retail - The original sNN_Product.price of the product
  • base_price - The retail + any Legacy Price Group discounts
  • price - The base_price + any regular Price Group discounts
@steveosoule
steveosoule / miva-output-all-qualified-excluded-price-groups-for-a-basket-resolved-pricegroup-and-module-list-load-basket.xml
Created September 1, 2021 15:31
Miva - Output All Qualified/Excluded Price Groups For A Basket - ResolvedPricegroupAndModuleList_Load_Basket
<mvt:do file="g.Module_Feature_PGR_UT" name="l.null" value="ResolvedPricegroupAndModuleList_Load_Basket( g.Basket, l.pricegroups )" />
<mvt:do file="g.Module_JSON" name="l.json" value="JSON_Output( l.pricegroups )" />
<mvt:eval expr="l.json" />
@steveosoule
steveosoule / font-weights.md
Created May 12, 2021 21:24 — forked from lukaszgrolik/font-weights.md
Commonly used names for CSS font-weight values

unknown source

value name
100 extralight/ultralight
200 light/thin
300 book/demi/light
400 regular/normal
500 medium
600 semibold/demibold
@steveosoule
steveosoule / request-body.json
Created April 6, 2021 17:49
Miva - JSON API: Move orders between multiple Order Workflows without OrderList_Acknowledge
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "OrderCustomFields_Update",
"Order_ID": "{{Order_Id}}",
"CustomField_Values": {
"orderworkflow": {
"new_and_updated": 0,
"successfully_retrieved_orders": 1
}
@steveosoule
steveosoule / miva-redis-flushall-with-mvt.xml
Last active December 22, 2022 22:56
Miva - Redis Flush-All with MVT
<mvt:if expr="g.Store:cache_type EQ 'redis'">
<mvt:assign name="l.redis_test:redis_connect" value="redis_connect(g.Store:redishost, g.Store:redisport, l.redis_test:conn_id)" />
<mvt:assign name="l.redis_test:redis_flushdb" value="redis_flushdb( l.redis_test:conn_id )" />
<mvt:assign name="l.redis_test:redis_disconnect" value="redis_disconnect( l.redis_test:conn_id )" />
</mvt:if>
<mvt:assign name="g.mvt_debug" value="glosub( miva_array_serialize( l.redis_test ), ',', asciichar( 10 ) )" />
@@l.redis_test
&mvt:global:mvt_debug;
@steveosoule
steveosoule / miva-9-vs-miva-10-navigation-set-data-structure-changes.txt
Last active November 17, 2020 15:35
Miva 9 vs Miva 10 Navigation Set Data-Structure Changes
Miva 10
:code
:navigationitems[1]:active
:navigationitems[1]:disp_order
:navigationitems[1]:id
:navigationitems[1]:link
:navigationitems[1]:link_dest
:navigationitems[1]:link_targ
:navigationitems[1]:link_type
@steveosoule
steveosoule / git-production-sync-incrimental-commits.sh
Last active November 16, 2020 20:49
git-production-sync-incrimental-commits
git add \*.json && git commit -m "production sync of json files"
git add -A && git diff --cached -w | git apply --cached -R && git commit -m "production sync of whitespace changes"
git add -A && git commit -m "production sync of template changes"
@steveosoule
steveosoule / miva-clear-stale-charges.xml
Last active June 15, 2021 19:41
Miva - Clear Stale Charges
<mvt:if expr="l.settings:page:code IN 'BASK,OCST,OSEL'">
<mvt:comment>
Delete the charges
</mvt:comment>
<mvt:do file="g.Module_Library_DB" name="l.success" value="BasketCharge_Delete_All_Type( g.Basket:basket_id, 'SHIPPING' )" />
<mvt:do file="g.Module_Library_DB" name="l.success" value="BasketCharge_Delete_All_Type( g.Basket:basket_id, 'TAX' )" />
<mvt:comment>
Reload the proper data
</mvt:comment>
@steveosoule
steveosoule / git-commands.sh
Last active August 5, 2020 23:46
Git Commands
# To sort branches by commit date
git branch --sort=-committerdate
# Checkout previous branch
git checkout -
# List branches along with commit ID, commit message and remote
git branch -vv
# Copy file from another branch to current branch