<commit_before><?php
/**
 * @package modules.order.lib.blocks
 */
class order_BlockShortCartAction extends website_BlockAction
{
	/**
	 * @param f_mvc_Request $request
	 * @param f_mvc_Response $response
	 * @return String
	 */
	function execute($request, $response)
	{
		if (catalog_ShopService::getInstance()->getCurrentShop() === null)
		{
			return website_BlockView::DUMMY;
		}
		$ops = order_OrderProcessService::getInstance();
		$op = $ops->loadFromSession();
		// Get the current cart from session.
		$cs = order_CartService::getInstance();
		$cart = $cs->getDocumentInstanceFromSession();
		$request->setAttribute('cart', $cart);
		
		// Check if order process is started or not.
		$currentPage = website_WebsiteModuleService::getInstance()->getCurrentPage();
		if ($op->inProcess())
		{
			
			$opURL = $op->getOrderProcessURL();
			if (strpos($opURL, RequestContext::getInstance()->getPathURI()) === false)
			{
				$request->setAttribute('processUrl', $opURL);
			}	
			return 'Process';
		}
		else
		{
			// If we are on the cart page, do not set link.
			$ts = TagService::getInstance();
			$request->setAttribute('setLinks', !$ts->hasTag($currentPage, 'contextual_website_website_modules_order_cart'));
			<commit_msg>[FIX #27219] Panier: lien 'je poursuite ma commande'<commit_after><?php
/**
 * @package modules.order.lib.blocks
 */
class order_BlockShortCartAction extends website_BlockAction
{
	/**
	 * @param f_mvc_Request $request
	 * @param f_mvc_Response $response
	 * @return String
	 */
	function execute($request, $response)
	{
		if (catalog_ShopService::getInstance()->getCurrentShop() === null)
		{
			return website_BlockView::DUMMY;
		}
		$ops = order_OrderProcessService::getInstance();
		$op = $ops->loadFromSession();
		// Get the current cart from session.
		$cs = order_CartService::getInstance();
		$cart = $cs->getDocumentInstanceFromSession();
		$request->setAttribute('cart', $cart);
		
		// Check if order process is started or not.
		$currentPage = website_WebsiteModuleService::getInstance()->getCurrentPage();
		if ($op->inProcess())
		{
			// Set the url only if it is not the current page.
			$opURL = $op->getOrderProcessURL();
			if (strpos($opURL, '?') !== false)
			{
				list($urlToCheck, ) = explode('?', $opURL);
			}
			else
			{
				$urlToCheck = $opURL;
			}
			
			if ($urlToCheck != $_SERVER['SCRIPT_URI'])
			{
				$request->setAttribute('processUrl', $opURL);
			}	
			return 'Process';
		}
		else
		{
			// If we are on the cart page, do not set link.
			$ts = TagService::getInstance();
			$request->setAttribute('setLinks', !$ts->hasTag($currentPage, 'contextual_website_website_modules_order_cart'));
			
{'fraction_non_alphanumeric': 0.15560554930633672, 'fraction_numerical': 0.0018747656542932134, 'mean_word_length': 4.231372549019608, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3421006', 'n_tokens_mistral': 958, 'n_tokens_neox': 838, 'n_words': 182}