Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default way to use shopp() tags
#1
Shopp uses its own shopp() tag to retrieve information on products, categories/collections, cart, cartitem and so on.

The tag always uses 3 arguments at most,

Code:
shopp('Object', 'property', 'options');

or 2 arguments when using dot notation.

Code:
shopp('Object.property', 'options');

The 'options' argument is not always needed.

Let's say you want to display the name of a product, the tag would be:

Code:
shopp('product', 'name');

or with dot notation

shopp('product.name');

The shopp tags can be used in the template files to display information, but also in custom functions.

Let's say you do not want to display the name of the product directly, but need to perform some tests first.

Code:
$name = shopp('product.get-name');
if ( 'some product name' == $name )
   // do something

Shopp tags are documented here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)