Invalid credentials for ‘https://repo.magento.com/packages.json’, aborting

Invalid credentials for ‘https://repo.magento.com/packages.json’, aborting

The error message “Invalid credentials for ‘https://repo.magento.com/packages.json‘, aborting” typically occurs when trying to authenticate with Magento’s Composer repository using incorrect or missing credentials. This issue often arises due to an incorrect username or password in your auth.json file or when your Magento Marketplace API keys are not properly configured. To resolve this, ensure that your authentication details are correct by verifying your public key (as the username) and private key (as the password) from your Magento Marketplace account. Then, update your Composer authentication using the following command:

composer config --global --auth http-basic.repo.magento.com your-public-key your-private-key

After updating the credentials, try running the Composer command again. If the issue persists, consider clearing Composer’s cache using composer clear-cache and ensuring that your network connection is stable.

How to enable star rating in Magento2

How to enable star rating in Magento2

The star rating enable is easy process in magento2. Follow below steps :

Login into Admin Panel then go to

Stores -> Attributes -> Rating
Click on Price, Value, Quality Row and Checked Is Enable Checkbox from page and also set Visibility for your required store.

Save Rating and your ratings are display.

Clear cache and check in product details page.

magento2 CMS pages 404 error

Magento2 CMS pages 404 error

Today I will show you, how you can fix the magento2 CMS pages 404 error. I got many times this issue while working on the magento 2 site. So finally I think, the fixes tricks may can help other person. This issue occurred due to single mode of the magento2 site.  Please follow below steps :

  1. Disable single store mode (admin>stores>configuration>general>general)
  2. Assign a store view to the CMS page.
    • go to your cms pages ( admin>content>pages)
    • edit the page which gives you the 404 message
    • Set the store view to “All Store Views”
    • save the page
  3. enable single store mode(admin>stores>configuration>general>general) (If you don’t want to site be single mode then leave this step)
  4. refresh cache (admin>system>cache management)

 

That’s all!!

 

Enable AJAX Submit in GravityForms in wordpress

Enable AJAX Submit in GravityForms in wordpress

To enable AJAX form submission in Gravity Forms on your WordPress site, simply navigate to the form settings and enable the AJAX option.

This allows users to submit forms without a page reload, enhancing user experience and improving performance. To activate AJAX, use the shortcode [gravityform id="1" ajax="true"], replacing "1" with your actual form ID.

Alternatively, if adding the form via PHP, use gravity_form(1, false, false, false, '', true);.

Enabling AJAX ensures smoother interactions, reduces page load times, and provides instant feedback, making it ideal for modern, dynamic websites.

How to enable error reporting in Magento2

How you can enable error reporting in magento2 :

Connect FTP OR login into cpanel account and go to the following directory

pub/errors

find the local.xml.sample and rename to local.xml

and also on magento root folder find index.php and put the display error code at the bottom

error_reporting(E_ALL);
ini_set(‘display_errors’, 1);

Change woocommerce price position

If want to change the position of the price in wocommerce then this is possible. You can it easy in adding little code in the functions.php file.

If you want to put price near add to cart button then please add following code to Functions.php file of your child theme (or parent theme, if not using a child theme)- you can use Dashboard -> Appearance > Editor or direct FTP

remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );
add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 29 );

How to override .phtml files in Magento 2

Here is tips for how to override .phtml files in Magento 2. Please follow below steps

vendor/vendor/magento/module-checkout/view/frontend/templates/onepage.phtml

Follow this path

app/design/frontend/Vendor/theme/Magento_Checkout/templates/onepage.phtml

Show only single category posts on WordPress archive page

To display only a single category’s posts on a WordPress archive page, you can modify your theme’s functions.php file or create a custom template. The best approach is to use the pre_get_posts hook, which allows you to filter the query before WordPress retrieves posts. Here’s an optimized way to do it:

function filter_archive_by_category( $query ) {
if ( !is_admin() && $query->is_archive() && $query->is_main_query() ) {
$query->set( 'cat', 12 ); // Replace 12 with your category ID
}
}
add_action( 'pre_get_posts', 'filter_archive_by_category' );

This snippet ensures that only posts from a specific category appear on archive pages while maintaining performance and compatibility. You can replace the category ID (12) with the desired category’s ID, which can be found in the WordPress admin panel under Posts > Categories. This method is ideal for keeping your theme lightweight and SEO-friendly without modifying core files.

Magento2 admin account disabled error

Magento2 admin account disabled error:

Hello All,

If you get issue something below on the Magento2 login page

 

 

Simply below query to database via phpmyadmin.

Example is for reset password for admin user.

UPDATE admin_user SET password = CONCAT(SHA2(‘xxxxxxxxNewPassword’, 256), ‘:xxxxxxxx:1’) WHERE username = ‘admin’;

NewPassword : Replace it with your password.

 

Hope it will work.

Get Magento catalog image

Today  I will show you how you can get the magento catalog image via code on any page. Please use below code and you will be done!!

 

Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(100);