Jump to content

 

thecigarhut

Member Since 07 Dec 2021
Offline Last Active Yesterday, 10:44 PM
-----

Topics I've Started

Here's A Handy Snippet For Admin Notifications With Customer Id And Ip

11 July 2022 - 10:07 PM

my old system included customer ID and IP address in the order notifications sent via email, CS-Cart does not do that by default (you have to log into orders section to find the IP etc. so I created this snippet that I call at the bottom of each admin notification after the footer snippet

 

1st, create a snippet like so

 

Name Customer ID and IP
code cID_IP
 
add this code into it
{% if  order_info.ip_address %}
<p style="color: #787878; font-size: 14px; font-family: Helvetica, Arial, sans-serif; padding-bottom: 5px; margin: 0px;">
<span style="color: #444444; font-weight: 600; font-family: Helvetica, Arial, sans-serif; text-transform: uppercase;">{{__("cID_Number")}}</span> {{order_info.user_id}}</p>
{% endif %}
{% if  order_info.ip_address %}
<p style="color: #787878; font-size: 14px; font-family: Helvetica, Arial, sans-serif; padding-bottom: 5px; margin: 0px;">
<span style="color: #444444; font-weight: 600; font-family: Helvetica, Arial, sans-serif; text-transform: uppercase;">{{__("ip_address")}}</span> {{order_info.ip_address}}</p>
{% endif %}

in your language settings, create this

Language Variable cID_Number

Value cID Number: 

 

 

then in the admin notification templates in the order section add this to the bottom of each below the footer snippet
 

{{ snippet("cID_IP") }}

it will then give you this bit at the bottom of each order notification
 

cID Number: 12345

IP address 123.456.78.9

 

 

hope it is helpful to any of you 


Notification Snippet To Count Shippings?

30 June 2022 - 06:33 PM

I'm trying to add a note in the customer order summary where if there are more than 1 shipping methods used in the order (bought from more than 1 supplier) the customer would get an included text that his order will be shipped in multiple packages

 

What I need to do is figure out how to count the # of entries in this variable

 

{{o.shippings_method}}

 

Currently the template will just list all methods used, is there a way to do something like this?

 

{% if o.shippings_method >1 %}
my custom text here
{% endif %}
 
this obviously does not work but how do you count the # of methods included?

Sort Order Of Rating Block On Homepage?

18 June 2022 - 11:20 PM

I have a block on the homepage and the filling is set to "Rating"

Works but problem is that it lists products by rating then alphabetically and completely ignores those products with hundreds of reviews, but instead lists all the 5 star reviews 1st regardless of 1 or 2 reviews only.

I want to change it to sort by # of reviews instead of alphabetical

 

I found this bit of code that does it but not the code that is used for the block filling "Rating"

 

/app/addons/product_reviews?func.php

    $params['sort_by'] = 'rating';
    $params['sort_order'] = 'desc';
    $sortings['rating'] = ['average_rating', 'product_reviews_count'];

In a nutshell, I want a product with 4.6 stars and 100+ ratings to appear in the block before a 5 star with just 1 review

Does anyone know where the function is located that produces the block filling type "Rating"?


Product Bundles, Multiple Promotions Applied In Error?

05 May 2022 - 08:08 PM

So here is the scenario, I sell flavor combos of a certain product line at discounted pricing

 

created a combo of 4 flavors and another of 5 flavors
when the 5 flavor combo bundle is added to cart, the discount from BOTH the 4 flavor and 5 flavor combo gets applied

 

eg,

product bundle #1 of 4 items: Amaretto, Cherry, Honey and Rum flavors
product bundle $2 of 5 items: Amaretto, Cherry, Honey, Rum and Vanilla flavors

 

add the 5 item bundle to the cart and promotion discounts for both the 4 and 5 item combos gets discounted,
I can see why as items from bundle 1 are also included in bundle 2 but does anyone know how to avoid the double discounts being applied?

Product Bundles does not have the ability to stop other rules being applied like as found in the Promotions tab.

 

aside from changing the combos to remove any possible item duplications does anyone have any suggestions?


Google Mod_Pagespeed On Apache Server, Yes Or No?

12 April 2022 - 04:23 PM

Looking in the forums I don't really see a definitive answer to use mod_pagespeed or not. Last mention of it is from 2018. some say they had good speed experiences, other mentions from a decade ago say not well supported in CS-Cart.

Yes or no, should I enable it on my server? (I am thinking yes)

 

for those that are unfamiliar (like I was until a few hours ago) here is some good info on what it does
https://stackoverflo...od-pagespeed-do

 

Seems to be all mentions of it on the web are old and I'm wondering if it is still relevant and worthwhile