<?php

declare(strict_types=1);

namespace MyCustomizer\WooCommerce\Connector\Libs;

class MczrProduct
{
    public const SETTING_OPTION_PREFIX = 'mczrSetting';

    public function buildProductUrl(int $productId, bool $encode = true): string
    {
        $url = \get_permalink($productId);
        $parsed = parse_url($url);

        $url .= (isset($parsed['query'])) ? '&' : '?';
        $url .= 'designId=<designId>&token=<token>';
        if ($encode) {
            return urlencode($url);
        }

        return $url;
    }
}
