Skip to content
  1. Extras
  2. msWallpapers
  3. Snippets
  4. mswp.form

mswp.form

Main component snippet that outputs the wallpaper order form on the frontend.

Parameters

NameDefaultDescription
id0Product ID; default is current resource.
imageTexture image. Required.
unitmmUnit of measure. Values: mm, cm, m.
width2700Width in selected unit.
height1800Height in selected unit.
min3Minimum area (sq m) from which price is calculated.
spacingStripes450Spacing between stripes for "Show stripes". In selected unit.
preview_width800Max preview area width in pixels.
preview_height300Max preview area height in pixels.
cart_id0Cart resource ID for "Go to cart" button link.
tpltpl.mswp.formForm template chunk.

Examples

Form on product page

fenom
{'!mswp.form' | snippet: [
  'id' => $_modx->resource.id,
  'image' => $_modx->resource.image,
  'cart_id' => 7,
]}

Snippet is called on msProduct page. Cart resource ID = 7.

Form with max 800x800 px square preview

fenom
{'!mswp.form' | snippet: [
  'id' => $_modx->resource.id,
  'image' => $_modx->resource.image,
  'preview_width' => 800,
  'preview_height' => 800,
  'cart_id' => 7,
]}

If width and height in the form don't form a square, the form will have those proportions.

Form in cm with default 300x200 cm

fenom
{'!mswp.form' | snippet: [
  'id' => $_modx->resource.id,
  'image' => $_modx->resource.image,
  'unit' => 'cm',
  'width' => 300,
  'height' => 200,
  'cart_id' => 7,
]}

Form in m with default 3.5x2.5 m

fenom
{'!mswp.form' | snippet: [
  'id' => $_modx->resource.id,
  'image' => $_modx->resource.image,
  'unit' => 'm',
  'width' => 3.5,
  'height' => 2.5,
  'cart_id' => 7,
]}