I'm while using wordpress shopp wordpress plugin to sell items on my small site. On my small template file, I'm utilizing a shopp short code to show a specific category. It appears such as this:

<?php shopp('catalog','category','load=true&id=16'); ?>

I'd like the amount 16 to become changeable, and so i have saved the right dynamic number inside a variable the following:

<?php $shopid = get_field('store_id'); ?>

The Variable $shopid may be the correct number which should replace the '16' above. Now you ask ,, how do you place a flexible within the shopp shortcode? I attempted the following without luck:

<?php shopp('catalog','category','load=true&id=$shopid'); ?>

Any ideas how you can pull this off?

Within single-quoted strings variables aren't getting changed by their values:

Note: Unlike the double-cited and heredoc syntaxes, variables and escape sequences for special figures won't be broadened once they exist in single cited strings.

Use double quotes or string concatenation rather:



<?php shopp('catalog','category',"load=true&id=$shopid"); ?>

Spot the double quotes. Or:

<?php shopp('catalog','category','load=true&id=' . $shopid); ?>

This really is concatenation.