I am using the wordpress shopp plugin to sell products on my site. On my template file, I am using a shopp short code to display a particular category. It looks like this:
<?php shopp('catalog','category','load=true&id=16'); ?>
I would like the number 16 to be changeable, so I have stored the correct dynamic number in a variable as follows:
<?php $shopid = get_field('store_id'); ?>
The Variable $shopid is the correct number that should replace the ‘16‘ above. The question is, how do I place a variable in the shopp shortcode? I tried as follows without luck:
<?php shopp('catalog','category','load=true&id=$shopid'); ?>
Any ideas how to pull this off?
Within single-quoted strings variables are not getting replaced by their values:
Use double quotes or string concatenation instead: