Show Posts


Messages - OneMore

Pages: [1] 2 3 4
1
Hello Basara and thank you.

I had a look at "system/logs/error.txt" and all errors were coming from missing language translations.

I after disabling my custom French translation, the problem disappeared.

My translation is still incomplete, and may contain errors or missing files or strings.
I assume the default template was more robust as possibly not using those strings.

Code: [Select]
2024-02-27 12:11:50 - App Error:  AbanteCart core v.1.3.4 Missing default English definition XML file for custom_french/custom_french !
Trace:
#0 C:\xampp8\htdocs\abantecart134\core\engine\language.php on line 920
#1 C:\xampp8\htdocs\abantecart134\core\engine\language.php on line 656
#2 C:\xampp8\htdocs\abantecart134\core\engine\extensions.php on line 1156
#3 C:\xampp8\htdocs\abantecart134\core\engine\extensions.php on line 383
#4 C:\xampp8\htdocs\abantecart134\core\engine\language.php on line 234

2024-02-27 12:11:50 - App Error:  AbanteCart core v.1.3.4 Could not load language custom_french/custom_french from file "C:/xampp8/htdocs/abantecart134/admin/language/english/custom_french/custom_french.xml"!
Trace:
#0 C:\xampp8\htdocs\abantecart134\core\engine\language.php on line 928
#1 C:\xampp8\htdocs\abantecart134\core\engine\language.php on line 656
#2 C:\xampp8\htdocs\abantecart134\core\engine\extensions.php on line 1156
#3 C:\xampp8\htdocs\abantecart134\core\engine\extensions.php on line 383
#4 C:\xampp8\htdocs\abantecart134\core\engine\language.php on line 234

One idea in such a case would be having a failover mechanism that takes the original English string.
I didn't study if it would be easy or difficult to implement.

2
Hello,

I plan selling mostly unique (spare) parts, and items in small quantities, and without quantity discounts, nor priced options.

On the product page, how can one prevent setting a quantity higher than the inventory level being added to the cart?
I would like to control the quantity enterd in the quantity field, as well as disable the "Add to cart" button if the quantity already in cart
plus the quantity mentioned are above the inventory level.

Exploring the source code with the browser development tools, the field is:
Quote
<input type="text" name="quantity" id="product_quantity" value="1" placeholder="" class="form-control short" size="3">

If the number of a given product in stock is 3, I would like to modify it to:
Quote
<input type="number" min="0" max="3" name="quantity" id="product_quantity" value="1" placeholder="" class="form-control short" size="3">

Doing a grep search,I could find the "product_quantity" string only in ".../templates/embed/js_product.tpl", but modifying the code there was without effect, even after clearing the cache.

So far, I could not find where in the code the "product_quantity" field is generated ...  :-[
Who can help?

3
Hello,

As a user of AbanteCart 1.2.11, I am currently testing Abantecart 1.3.4 on localhost with PHP 8.2.12.

The storefront had a totally blank page, apart from the welcome message.
(No change if adding a category, a product, and clearing the cache.)

I the template in use was "bootstrap5" instead of "default" one.

I switched the template from "bootstrap5" to the default one, and the storefront displays OK.

Likely are some additional requirements for the bootstrap5 template to display, but this is very confusing for beginners.

I would suggest keeping only the default template in the initial installation, and let people download alternative templates if they want.

Cheers.

4
Quote
I think 1.2.16 and 1.3.0 can run on PHP 7.1 why did you choose 1.2.11?

Quote
Because for AbanteCart 1.2.16 the minimal PHP version was not mentioned.
(...)
I believe that a similar PHP compatibility chart would be very useful fo AbanteCart.

See this link for AbanteCart's PHP compatibility chart:
https://abantecart.atlassian.net/wiki/spaces/AD/pages/3768390/AbanteCart+System+Requirements#AbanteCartSystemRequirements-PHPcompatibilitychart

Many thanks to the developers, testers, and editors fo the documentation.

5
Thank you Nuno.

So here's my quick implementation of a price beautifier.

A) Removing decimals in prices on PRODUCT PAGES
In 'storefront/view/default/template/pages/product/product.tpl', after line 94 (i.e. after the "if ($display_price){}" sandwich), add:
Code: [Select]
// Remove decimals for prices ending with ".00", for both special and normal prices.
           if (strpos($special,'CHF')) {
                $special=  str_replace('.00','.&ndash;',$special);
              } else {
                $special = str_replace('.00','',$special);
              }
          if (strpos($price,'CHF')) {
                $price=  str_replace('.00','.&ndash;',$price);
              } else {
                $price = str_replace('.00','',$price);
              }

How does it work
If the product price contains "CHF" (Swiss Franc), it will replace ".00" by ".–".
For all other currencies, it will replace ".00" by nothing.
This assumes you are only using the dot as separator for the trailing decimals".


Added 2024/02/27
B) Removing decimals in prices for FEATURED PRODUCTS
In 'storefront/view/default/template/blocks/product_list.tpl', after line 70:
1. Add
Code: [Select]
$special = $product['special'];
$price = $product['price'];
2. Copy and paste the aforementioned code that removes the decimals.
3. In the <div class="price"> ... </div> sandwich right after, replace echoed instances of $product['special'] by $special, and $product['price'] by $price.



Added 2024/02/27
C) Removing decimals in prices of products on CATEGORY PAGES
In 'storefront/view/default/template/pages/product/product_listing.tpl', after line 63, do the same as above for featured products.



Added 2024/02/27
Requirements
For the code above to work you need the decimal delimitor being the dot and not the comma.
Else, you would need to adapt the code.
To set the decimal delimitor:
  • Go to "System -> Localization -> Language Definitions"
  • In the "Key" field, write "decimal_point" and filter.
  • Set the "decimal_point" as "." and save it.

Suggestion for a better implementation
A better implementation would be creating an method, or modifying existing method, so that the same code can be re-used for all price formatting.
Another improvement would be adapting the code to deal with the effective decimal delimitor.


@llegrand: Sorry, but my question was about if the ".–" was international or used only in some countries like Switzerland.
Furthermore, setting the decimals to 0 is not what I wanted to do : 99.95 CHF must remain unchanged. Only 99.00 CHF should be displayed as 99.– CHF.

6
Development Help Needed / Re: (Solved) How to set blurb as meta description
« on: February 25, 2024, 06:04:23 AM »
Thank you fanteamgear.
I have access to the database, but decided to further explore how AbanteCart was getting the value of "meta_description", in order to not create additional database connection and query for a single field.

As in "product_description", AbanteCart was able to extract the value "meta_description", I searched for that string.
The missing part, was adding "$this->document->setBlurb($product_info['blurb']);" in product.tpl.
I edited my original post, so that everyone can benefit from the procedure.

Cheers.

7
General Support / How to know which layout a product is using?
« on: February 24, 2024, 03:06:25 PM »
Hi,

I am using the default theme and template.

In the list of layouts, I had a custom layout for one product "Product: My product title".
This was likely of an accidental duplicate of "Default product page" when I was experimenting with layouts.
In "Design > Layouts", I could delete the custom layout, and it seems that the product reverted back to using the default product layout.

However, I still have this question: how do I see which layout a product is using?
Apart the product name being listed in the layouts drop list (in "Design > Layout") I cannot see the information about the layout being used in the product page (Layout tab).

Thank you.

8
Quote
How do I make descriptions included in search by default?

Not sure of your exact question, but if you want the blurb as description in search engines, you would need to to change how the content the meta description is set in head.tpl .

I have done an attempt in this direction: https://forum.abantecart.com/index.php/topic,10650.0.html

9
Development Help Needed / (Solved) How to set blurb as meta description
« on: February 24, 2024, 02:22:13 PM »
Hi,

Here is how you can set the blurb as content for <meta name="description" > on your product pages when there is no meta_description set.
Tested as working with AbanteCart 1.2.11.

1)
Edit head.tpl and add the "elseif" clause as follows.
Code: [Select]
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description?>" />
<?php } elseif ($blurb) { ?>
<meta name="description" content="<?php echo $blurb?>" />
<?php ?>

2) Add a call to getBlurb() method at line 38 of head.php:
Code: [Select]
$this->view->assign('description', $this->document->getDescription());
$this->view->assign('blurb', $this->document->getBlurb());

3) Create a private variable $blurb, as well as setBlurb() and getBlurb() functions (i.e. methods) in document.php:
Code: [Select]
private $blurb;
Code: [Select]
public function setBlurb($blurb){
$this->blurb = $blurb;
}
Code: [Select]
public function getBlurb(){
return $this->blurb;
}

4) At line 157 of 'storefront/controller/pages/product/product.tpl', call setBlurb() right after the call that sets the meta_description.
      $this->document->setDescription($product_info['meta_description']);
      $this->document->setBlurb($product_info['blurb']);

10
Customization help / Re: Format price number
« on: February 23, 2024, 01:45:13 PM »
As a complement to previous answers, for those who want adding a space between the price and a currency code, this can be done in 'core\lib\currency.php', at at the end of the 'wrap_display_format' function (~ line 237), this way:

Code: [Select]
public function wrap_display_format($number, $currency = ''){
                (...)
return $symbol_left . $formatted_number .' '. $symbol_right;
}

Example case:
1200.00SEK will become 1200.00 SEK.


Edit on 2024/02/27:

And for those who want to strip decimals only for round numbers, here's how you can implement a "price beautifier":
https://forum.abantecart.com/index.php/topic,10649.msg40957.html#msg40957

11
In my country, it is common not showing cents for round prices, and replacing them with a dot and a dash, like 59.– instead of 59.00 .

Is this way of displaying prices is commonly understood worldwide or only in my country?

If known at international level, I will implement it in the templates used by my shop with code like:
Code: [Select]
<?php echo str_replace('.00','.&ndash;',$price); ?>

12
Extension Support / Re: Solved --- Translation problem
« on: February 23, 2024, 12:23:19 PM »
Thank you, Basara.
Since there are quite of lot of pages in "System->Localizations->Languages", for those having phpMyAdmin and knowledge of SQL, I assume it would be easier to issue a query like:
Code: [Select]
SELECT * FROM `abc_language_definitions` WHERE language_id=5Not sure however that it would trigger the reimport from XML files.
I will backup the table and then test.

13
Extension Support / Re: Solved --- Translation problem
« on: February 23, 2024, 06:10:25 AM »
Hello,

My shop is using the default French machine translation imported from GitHub.

Although most translations are understandable, there are some weird things, so that I want to make the translations myself.

Instead of editing the translations in "System->Localizations->Language Definitions", I prefer editing them in the XML files, making them reusable.

But then, how would I reimport the improved translations for backend and frontend without deleting the translations of products, categories (a.s.o.), and keeping the same language ID.
I there a way to update translations from the XML files instead of inserting new records?

14
For those having many categories in the main menu, with — on computers — the last drop down tile beeing displayed beyond the page width, here is how you can bring it back to the left.

In "storefront/view/default/stylesheet/style.css", add:
Code: [Select]
section#categorymenu > nav.subnav > ul.categorymenu > li:last-child > a + div.subcategories {
  left:-200px;
}

15
My eCommerce mostly contains small and lightweight objects, so that I wanted the gram (instead of the kilogram) as main weight unit.

According to the documentation about weight:
 "The class set to 1.00000 is your base weight class. Any other weights in there need to be a factor of your base class."

So, instead of:
Weight TitleWeight UnitValue
Gramg1000
Kilogramkg1

I wanted to have:
Weight TitleWeight UnitValue
Gramg1
Kilogramkg0.001

But when editing, the "Value" field was read-only.

I could still make the edits by hitting the F12 key in the browser, and using the development tools to remove the "readonly" occurences in the source code for the concerned Value field, and save my edits.

However, I wonder why the lenght and weight value fields were read-only?
As a preventive measure because some extensions would possibly not be properly implemented to handle different main units properly?

Can someone check if also observing this, or if this limitation was only in my shop?

Thank you.

Pages: [1] 2 3 4

Powered by SMFPacks Social Login Mod