private function getDefaultTermsAndConditions() { $cms = new CMS(Configuration::get('PS_CONDITIONS_CMS_ID'), $this->context->language->id); $link = $this->context->link->getCMSLink($cms, $cms->link_rewrite, (bool) Configuration::get('PS_SSL_ENABLED')); $termsAndConditions = new TermsAndConditions(); $termsAndConditions->setText($this->translator->trans('I agree to the [terms of service] and will adhere to them unconditionally.', array(), 'Shop.Theme.Checkout'), $link)->setIdentifier('terms-and-conditions'); return $termsAndConditions; }
public function hookTermsAndConditions($param) { $returned_terms_and_conditions = array(); $cms_repository = $this->entity_manager->getRepository('CMS'); $cms_role_repository = $this->entity_manager->getRepository('CMSRole'); $cms_page_conditions_associated = $cms_role_repository->findOneByName(self::LEGAL_CONDITIONS); $cms_page_revocation_associated = $cms_role_repository->findOneByName(self::LEGAL_REVOCATION); if ((int) $cms_page_conditions_associated->id_cms > 0 && (int) $cms_page_revocation_associated->id_cms > 0) { $cms_conditions = $cms_repository->i10nFindOneById((int) $cms_page_conditions_associated->id_cms, (int) $this->context->language->id, (int) $this->context->shop->id); $link_conditions = $this->context->link->getCMSLink($cms_conditions, $cms_conditions->link_rewrite, (bool) Configuration::get('PS_SSL_ENABLED')); $cms_revocation = $cms_repository->i10nFindOneById((int) $cms_page_revocation_associated->id_cms, (int) $this->context->language->id, (int) $this->context->shop->id); $link_revocation = $this->context->link->getCMSLink($cms_revocation, $cms_revocation->link_rewrite, (bool) Configuration::get('PS_SSL_ENABLED')); $termsAndConditions = new TermsAndConditions(); $termsAndConditions->setText($this->l('I agree to the [terms of service] and [revocation terms] and will adhere to them unconditionally.', [], 'Checkout'), $link_conditions, $link_revocation)->setIdentifier('terms-and-conditions'); $returned_terms_and_conditions[] = $termsAndConditions; } if ((bool) Configuration::get('AEUC_LABEL_REVOCATION_VP') && $this->hasCartVirtualProduct($this->context->cart)) { $termsAndConditions = new TermsAndConditions(); $termsAndConditions->setText($this->trans('[1]For digital goods:[/1] I want immediate access to the digital content and I acknowledge that thereby I lose my right to cancel once the service has begun.[2][1]For services:[/1] I agree to the starting of the service and I acknowledge that I lose my right to cancel once the service has been fully performed.', array('[1]' => '<strong>', '[/1]' => '</strong>', '[2]' => '<br>'), 'Modules.LegalCompliance.Shop'))->setIdentifier('virtual-products'); $returned_terms_and_conditions[] = $termsAndConditions; } if (sizeof($returned_terms_and_conditions) > 0) { return $returned_terms_and_conditions; } else { return false; } }