Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed .env configuration #629

Merged
merged 3 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ jobs:
upload_url: ${{ steps.release_info.outputs.upload_url }}
asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion templates/catalog/_partials/miniatures/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
{/block}
</div>

{if $product.add_to_cart_url && $product.product_type !== 'combinations'}
{if $product.add_to_cart_url}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this diff? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to this PR: #609

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that. But it seems that it breaks UI tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's an issue about UI tests then.
If we merge your diff, we reintroduce the "Add to cart" button for combinations products, and his buggy behaviour in that particular case 🤔

But anyway, I don't block your PR, just I prefer to warn you about this! 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the change is legit, add to cart url should be handled on product lazy array settings. For combination, it's availability depends on prestashop settings (enable add to cart button in listings when product has combinations on/off).

<form action="{$urls.pages.cart}" method="post" class="d-flex flex-wrap flex-md-nowrap gap-3 align-items-center mt-3">
<input type="hidden" value="{$product.id_product}" name="id_product">

Expand Down
13 changes: 5 additions & 8 deletions webpack/webpack.vars.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
const fs = require('fs');
const path = require('path');

const themeDev = path.resolve(__dirname, '../src');

const envFilePath = './webpack/.env';

if (fs.existsSync(envFilePath)) {
require('dotenv').config({path: envFilePath});
} else {
console.error('\x1b[41m\x1b[37m%s\x1b[0m', 'Your .env file not exits. Read getting started section in documentation for more information https://github.com/PrestaShop/hummingbird?tab=readme-ov-file#how-to-build-assets/.');
process.exit();
}

const {
PORT: port,
PUBLIC_PATH: publicPath,
SERVER_ADDRESS: serverAddress,
SITE_URL: siteURL,
PORT: port = null,
PUBLIC_PATH: publicPath = null,
SERVER_ADDRESS: serverAddress = null,
SITE_URL: siteURL = null,
} = process.env;

const entriesArray = {
Expand Down
Loading