Skip to content

Commit

Permalink
Build package 1.0.0-beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
muzzwood committed Feb 3, 2021
1 parent 402aef1 commit 79c0c6b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getSnippetContent($filename = '') {
define('PKG_NAME', 'Commerce_ImageMeld');
define('PKG_NAMESPACE', 'commerce_imagemeld');
define('PKG_VERSION', '1.0.0');
define('PKG_RELEASE', 'beta2');
define('PKG_RELEASE', 'beta3');

/* load modx */
require_once dirname(__DIR__) . '/config.core.php';
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions core/components/commerce_imagemeld/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Commerce_ImageMeld for Commerce 1.0.0-beta3
---------------------------------
Released on 3/2/2021

- Snippet now returns core product values as placeholders

Commerce_ImageMeld for Commerce 1.0.0-beta2
---------------------------------
Released on 2/2/2021
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
);
if (!$comImageMeld instanceof \Commerce_ImageMeld) return '';

// Get snippet param values
$productId = $modx->getOption('productId', $scriptProperties);
$tplCanvas = $modx->getOption('tplCanvas', $scriptProperties,'commerce_imagemeld_canvas');
$tplHiddenInputs = $modx->getOption('tplHiddenInputs', $scriptProperties,'commerce_imagemeld_hidden_inputs');
Expand All @@ -15,8 +16,6 @@
$tplPreview = $modx->getOption('tplPreview', $scriptProperties,'commerce_imagemeld_preview');
$includeJs = $modx->getOption('includeJS', $scriptProperties,true);



// Set as str for JavaScript
$error = 'false';
// Check for a return error
Expand All @@ -27,6 +26,7 @@
$modx->setPlaceholder('cim.error_msg',$errorMsg);
}

// Inject meta
$assetsUrl = $modx->getOption('commerce_imagemeld.assets_url');
$modx->regClientStartupScript('https://cdnjs.cloudflare.com/ajax/libs/fabric.js/4.3.0/fabric.min.js');
$minWidth = $modx->getOption('commerce_imagemeld.min_width');
Expand All @@ -45,6 +45,7 @@
$modx->regClientStartupScript($assetsUrl . 'web/js/imagemeld.js');
}

// Set imagemeld placeholders
$modx->setPlaceholder('cim.product_id',$productId);
$modx->setPlaceholder('cim.canvas',$modx->getChunk($tplCanvas));
$modx->setPlaceholder('cim.hidden_inputs',$modx->getChunk($tplHiddenInputs));
Expand All @@ -53,7 +54,7 @@
$modx->setPlaceholder('cim.preview',$modx->getChunk($tplPreview));
$modx->setPlaceholder('cim.default_css',$modx->getChunk('commerce_imagemeld_css'));


// Return standard product values as placeholders
$product = $comImageMeld->commerce->adapter->getObject('comProduct', ['id' => $productId, 'removed' => false]);
if ($product instanceof \comProduct) {
$modx->setPlaceholders($product->toArray());
Expand Down
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ Example Template
});
if(cimError !== false) {
$('#errorReturnModal').foundation('open');
// Optional: add the following to remove params from url to prevent modal showing again on page reload.
var currentUrl = window.location.href;
var newUrl = currentUrl.split('?')[0];
window.history.replaceState({}, document.title, newUrl);
}
});
</script>
Expand Down

0 comments on commit 79c0c6b

Please sign in to comment.