Post by //commented » Thu Jun 13, 2024 10:07 pm

How can I remove the Newsletter subscription option in the order finalization page on OC v. 4.0.2.3. For some reason I have this option only for guest users, the ones who are logged in do not see it, anyways I do not need it for any kind of users.

Newbie

Posts

Joined
Thu Jun 13, 2024 9:42 pm

Post by Johnathan » Thu Jun 13, 2024 10:32 pm

My 4.0 Checkout Improvements extension will have this an option in the next update. If you purchase the extension and want to get a pre-release before it's officially released, feel free to contact me and I can send you a copy:

www.getclearthinking.com/contact

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by grecha861 » Tue Jun 18, 2024 4:45 pm

Hello,

Thanks for creating this post. Can you tell me if your query is solved? If yes please share with BCZ I can face a similar issue like yours.

Best Regard,
Gregory Chavez

McDVOICE


Newbie

Posts

Joined
Tue Jun 18, 2024 4:36 pm

Post by //commented » Thu Jun 27, 2024 7:58 pm

grecha861 wrote:
Tue Jun 18, 2024 4:45 pm
Hello,

Thanks for creating this post. Can you tell me if your query is solved? If yes please share with BCZ I can face a similar issue like yours.

Best Regard,
Gregory Chavez
Hello, I did not resolve it, I just left the newsletter on the page.

Newbie

Posts

Joined
Thu Jun 13, 2024 9:42 pm

Post by paulfeakins » Fri Jun 28, 2024 6:37 pm

//commented wrote:
Thu Jun 13, 2024 10:07 pm
How can I remove the Newsletter subscription option in the order finalization page on OC v. 4.0.2.3. For some reason I have this option only for guest users, the ones who are logged in do not see it, anyways I do not need it for any kind of users.
OC 4.0.2.3 doesn't have OCMOD, but 4.0.2.4 (it might be called 4.1.0.0) should have it and that will make this a very easy extension to make.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by geografixx » Mon Jul 22, 2024 10:27 pm

Hi!
To remove the Newsletter subscription option from the order finalization page in OpenCart version 4.0.2.3, you need to modify the relevant template file and possibly the controller handling the checkout process. Here's a step-by-step guide:

### Step 1: Locate the Checkout Template File
1. **Access your OpenCart installation files** through FTP or your hosting control panel.
2. **Navigate to the template directory** for your theme, which is usually found at:

Code: Select all

 catalog/view/theme/{your-theme}/template/checkout

3. **Open the file** that handles the checkout confirmation. This file is commonly named `confirm.twig` or `checkout.twig`.

### Step 2: Modify the Template File
1. **Open the template file** in a code editor.
2. **Find the section** of the code that generates the Newsletter subscription option. It will look something like this:

Code: Select all

<div class="form-group">
       <label for="input-newsletter">{{ entry_newsletter }}</label>
       <select name="newsletter" id="input-newsletter" class="form-control">
           <option value="1">{{ text_yes }}</option>
           <option value="0">{{ text_no }}</option>
       </select>
   </div>

3. **Remove or comment out** this section of the code. You can comment it out by surrounding it with `{#` and `#}`:

Code: Select all

 {#
   <div class="form-group">
       <label for="input-newsletter">{{ entry_newsletter }}</label>
       <select name="newsletter" id="input-newsletter" class="form-control">
           <option value="1">{{ text_yes }}</option>
           <option value="0">{{ text_no }}</option>
       </select>
   </div>
   #}


### Step 3: Update the Controller (if needed)
1. **Navigate to the controller** handling the checkout process, usually located at:
catalog/controller/checkout

2. **Open the relevant controller file**, such as `confirm.php` or `checkout.php`.
3. **Find the part of the code** that processes the newsletter subscription. It might look like this:

Code: Select all

if (isset($this->request->post['newsletter'])) {
       $newsletter = $this->request->post['newsletter'];
   } else {
       $newsletter = 0;
   }

4. **Remove or comment out** the code that handles the newsletter subscription.

### Step 4: Clear the Cache
1. **Go to your OpenCart admin panel.**
2. **Navigate to Extensions > Modifications**.
3. **Click on the refresh button** to rebuild the modification cache.
4. **Navigate to Dashboard > Developer Settings**.
5. **Click on the refresh button** to clear the theme cache.

### Step 5: Test Your Changes
1. **Go to your store's checkout page**.
2. **Verify** that the Newsletter subscription option has been removed.

By following these steps, you should be able to remove the Newsletter subscription option from the checkout page in OpenCart 4.0.2.3.

Newbie

Posts

Joined
Mon Jul 22, 2024 10:09 pm
Location - Pembroke Pines, FL
Who is online

Users browsing this forum: No registered users and 2 guests