Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2020-05-02 19:05:14

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Cart question

Hi everyone,

For the Cart module, when you put a percentage value in the attributes, is it possible on the Front-end to display only the price in the drop-down list and hide the percentage after the price:

Capture-d-cran-2020-05-02-11-59-36.jpg

Thanks in advance
Nico

Offline

#2 2020-05-05 19:47:15

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart question

Anyone?

smile

Offline

#3 2020-05-05 20:32:10

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Cart question

Do you mean to display something like -24,91 E ? (which is 71.38 percent of 34.90)

Offline

#4 2020-05-05 20:53:52

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart question

No just the value « 6 mois » without percentage

Last edited by Nico3939 (2020-05-05 20:54:26)

Offline

#5 2020-05-05 23:50:12

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart question

I have find Ajax_item_options.php in module-cart>application>js who contain this code:

$purchaseOption = '<fieldset>' . $LINE_END;
	$purchaseOption .= '<input type="hidden" name="on' . $count . '" value="' . $attribute['title'] . '">' . $LINE_END;
	$purchaseOption .= '<label for="os' . $count . '">' .  $attribute['title'] . ': </label>' . $LINE_END;
	
	if (count($attribute['options']) == 1) {
		foreach ($attribute['options'] as $option) {
			$purchaseOption .= '<span class="text_option">'.$option['title'];
			$purchaseOption .= '</span>';
			$purchaseOption .= '<input type="hidden" name="os' . $count . '" id="os' . $count . '" value="'.str_replace('"', '&quot;', $option['title']).'">' . $LINE_END;
		}
	} else {
		
		$purchaseOption .= '<select name="os' . $count . '" id="os' . $count . '">' . $LINE_END;

		foreach ($attribute['options'] as $option) {
			$purchaseOption .= '<option value="' . str_replace('"', '&quot;', $option['title']) . '"';

			if ($item != null && isset($item->options[$attribute['title']]) && $item->options[$attribute['title']] == $option['title']) {
				$purchaseOption .= ' selected';
			}

			$purchaseOption .= '>' . $option['title'];
			$purchaseOption . '</option>' . $LINE_END;
		}

		$purchaseOption .= '</select>' . $LINE_END;
	}
	
	$purchaseOption .= '</fieldset>' . $LINE_END;

	return $purchaseOption;
}

Because of this with the web inspector:

Capture-d-cran-2020-05-05-16-34-22.png

But nothing happens

Nico

Offline

Board footer

Powered by FluxBB