texts: Magento API V2 catalogProductAttributeAddOption (with compliance mode) - add attribute

texts:
I am trying to call catalogProductAttributeAddOption with V2 of Magento's API with compliance mode enabled but am getting:

call to undefined method stdClass::catalogProductAttributeAddOption()

My immediate observation was that this method is not present as soon as compliance mode is switched on. Therefore, I added (what I think are) the correct nodes to a wsi.xml file within a custom module:

<xsd:element name="catalogProductAttributeAddOptionRequestParam">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string"/>
                    <xsd:element minOccurs="1" maxOccurs="1" name="attribute" type="xsd:string"/>
                    <xsd:element minOccurs="0" maxOccurs="1" name="data" type="typens:catalogProductAttributeOptionEntityToAdd"/>
                </xsd:sequence>
            </xsd:complexType>
</xsd:element>

etc..

This ensures that the method is displayed within the WSDL and matches the same pattern as other existing methods.

Now I am just trying to figure out where this method actually needs to be defined. Am I right in thinking there should be a Api2.php file within Catalog/Model where this should happen?

Is this method already defined somewhere to work without compliance mode which could be modified? I have searched globally and can't find a thing


texts: Magento 1.9.1.0 Admin panel date in Finnish

texts: I updated Magento to the 1.9.1.0 version and noticed that in Finnish the admin panel date on the upper right corner shows each day in "cccc". When I change the language the date is normal, for example today it's "Friday, 6 March 2015" but when I change to Finnish, the date is "cccc 6. maaliskuuta 2015". I'm not sure where this should be translated, but at least the "translate.csv" does not affect the cccc. It's a small issue but would be nice to have fixed, so any advice would be appreciated.


texts: How to get visitor log (customer) collection

texts:
I'm looking to load the log/customer collection and am running into some issues.

When using Mage::getModel('log/customer')->load(1); the appropriate data is returned but if I try to load the collection, it just returns false.

Here is what was tried:

Mage::getModel('log/customer')->getCollection(); //returns false
Mage::getResourceModel('log/customer_collection'); //returns false

Any suggestions


texts: Magento 2.3.4 upgrade to 2.3.5 --> Module 'Magento_MysqlMq': Error while checking if topic is synchronous

texts:
After the upgrade when running setup:upgrade I get this error
Module 'Magento_MysqlMq':
Error while checking if topic is synchronous
In my system.log
[2020-08-27 08:14:18] main.ERROR: Topic "inventory.source.items.cleanup" is not configured. [] []
[2020-08-27 08:21:45] main.INFO: Consumer "async.operations.all" skipped as required connection "amqp" is not configured. Unknown connection name amqp [] []
[2020-08-27 08:24:05] main.ERROR: Topic "inventory.source.items.cleanup" is not configured. [] []


texts: How to show product category in admin grid

texts:
I have a grid in admin where I am showing orders based on some filters,
I want to show the  category of ordered item in one of the column ,How can I do that?
Thank you.


texts: Diiference between Page Factory and Result Page Factory in Magento

texts:
What is the use of PageFactory and ResultPageFactory in Magento?
Major difference between both and for what both are used for


texts: getCollection of orders where completion date is today

texts:
I need to get a collection of all orders where the status is changed to completed today.

Currently i'm doing this:

$fromTime = date('Y-m-d', strtotime('yesterday midnight'));

$yesterdaysOrders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array('from' => $fromTime))
    ->addAttributeToFilter('status', array('eq' => Mage_Sales_Model_Order::STATE_COMPLETE));

But with this I only get orders CREATED today - not the once completed today.


texts: magento 2 hide shipping methods for specific state

texts:
I want to hide fedex and usps shipping methods for some states. I am trying to get the selected state in the getShippingMethods functions which returns the avaialable shipping methods. This function is in ShippingMethodManagement class.

I tried getting region id by $shippingAddress->getRegionId() but it just returns the default shipping address state, not the selected one.

I also tried getting the region id using checkout session but same result.

If anyone have the solution for this, please share.

thanks


texts: 2 columns left layout not working anymore on CMS pages?

texts:
Magento 2.3.3

I had the 2 columns left layout working until I changed it to 1 column and then back to 2 columns left. Now the view changes after switching, but it is not 2 columns left. So I tried setting it to 2 columns right and it looks exactly the same as left.

I checked the code and this is whats it looks for 2 columns left or right: https://i.imgur.com/tFYNeeG.png. I cleared the cache, recompiled redeployed, nothing made it work again. I also tried adding a new CMS page, same problem. Maybe the template files for the layouts are missing? Where would I find those on the server?

Any ideas?


texts: Magento 2.4.1: Uncaught Error: [object Object] at Object. (default.js:8474)

texts: The error as the post title appears in the cart page. default.js is the bundle that I created with advanced JS bundling. You can see that this is where the error has originated from. When looking at the line that causes the error, it appears to be impossible to fix. I'm not sure why this js error shows up. Please advise as to what needs to be done to fix this.


texts: Magento 1 Rewrite Pagination url Parameter

texts:
for sure this question has been asked so many times in different ways, but i didn't find anything usefull for my case.

We have an installation of Magento 1.9.3.6, the main task is to rewrite the pagination param to a SEO Friendly url param, for example:

http://www.example.com/category?p=2

to

http://www.example.com/category/p/2

we use nginx so the .htaccess ways is out, i'm trying to create a Router and an Observer (as the web suggest, maybe) that will rewrite the param if match, but i have one question:

If i allow magento to redirect the user to the correct page if in the URI there is "p=*" (with the Router & Observer way) it works, but how i REWRITE all the Links for example, in the pager? because also if magento allow to redirect to the correct page if there is a page param, the rendered urls in the whole rendered website are not rewrited.

Wich is the best way to do this? i need all the urls SEO Friendly and i won't use external modules.

Do you have any suggestions?

So many thanks in advance.


texts: Update block arguemnts in xml file (Recommended way not working)

texts:
Magento 2.0.2

File :- vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml

block :-

<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="product/view/attributes.phtml" group="detailed_info">
  <arguments>
     <argument translate="true" name="title" xsi:type="string">
        More Information
     </argument>
  </arguments>
</block>

I am overwriting this block in my module with same file name like this (by action method) and it is working:-

<referenceBlock name="product.attributes">
    <action method="setTitle">
       <argument name="title" xsi:type="string">Product Details</argument>
    </action>
</referenceBlock>

But when i updated this title by this below method (argument menthod) it is not working:-

<referenceBlock name="product.attributes">
    <arguments>
       <argument name="title" xsi:type="string">Product Details</argument>
    </arguments>
</referenceBlock>

So, my question here is that why it is working by first method, as it is mentioned in documentation that it is not a recommended way to modify block arguments
link


texts: Magento 2: Admin user with restricted access can access everything via API?

texts:
I have created an admin user to manage my orders and granted the access for order view action only. (as below)

But the user can generate token via API and access all order i.e view, delete, etc resources.

How to restrict the access to orders view only?


texts: How to change the title text on the invoice email?

texts:
How can I change the title text on the invoice email?

I always get this in my email when I make an order,

XX Store: Invoice # for Order # 100000037

I want to remove the # after the word of 'Invoice',

XX Store: Invoice for Order # 100000037

Is it possible? where can I change it?


texts:
When running PHP Code sniffer with the Magento 2 standard included in the dev tools on my code I receive the Ambiguous type array is NOT recommended warning quite frequently, is there a way to solve the warning?

php vendor/bin/phpcs --warning-severity=1 \
--standard=dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml \
-d memory_limit=1024M --encoding=utf-8 --extensions=php,phtml \
vendor/vendorName/moduleName/

  FOUND 0 ERROR(S) AND 3 WARNING(S) AFFECTING 3 LINE(S)

  24 | WARNING | Ambiguous type "array" for @var is NOT recommended
  42 | WARNING | Ambiguous type "array" for @return is NOT recommended
  63 | WARNING | Ambiguous type "array" for @return is NOT recommended


texts:
In version 1.4 there were two databases which held stored credit card numbers:

sales_flat_quote_payment     &    sales_orders_entity_varchar

The first one is still there in version 1.9 but not the second.

We like to delete these numbers regularly. Are there any other databases which hold CC numbers in ver 1.9 ?


texts: Unable to set canonical for Magento 2 homepage

texts:
I have added below code to my homepage by going to Content->Pages-> in layout xml under design. But doesn't seem to reflect in the frontend. I am using Magento 2.2.0 with Ultimo Theme

    <reference name="head">
  <action method="addLinkRel">
    <rel>canonical</rel>
    <href>https://www.example.com</href>
  </action>
</reference>


texts: Why Magento 2 uses both PSR-4 and PSR-0? What is the advantage of one over the other?

texts:
Below is the composer.json file in Magento 2, and it has used both PSR-4 and PSR-0. What is the advantages of using both in one project.
"autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": [
                "app/code/",
                "generated/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    }


texts: possible to write payment gateway log (braintree) into database?

texts: Is there anyway or reference I can follow, so no matter success or fail of payment transaction result from Braintree, record can be store in database table?


texts: Magento 2 - Add custom attribute in customer registration form

texts:
I want to add a custom attribute in customer registration form. I write a module with the following InstallData.php

<?php

namespace vendor\TestModule\Setup;

use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetup;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface {

    /**
     * Customer setup factory
     *
     * @var \Magento\Customer\Setup\CustomerSetupFactory
     */
    private $customerSetupFactory;

    public function __construct(CustomerSetupFactory $customerSetupFactory) {
        $this->customerSetupFactory = $customerSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
        $setup->startSetup();
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerSetup->addAttribute(Customer::ENTITY, 'client_idn', [
            'label' => 'Client IDN',
            'input' => 'text',
            'required' => false,
            'sort_order' => 40,
            'visible' => true,
            'system' => false,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'is_searchable_in_grid' => true]
        );

        // add attribute to form
        /** @var  $attribute */
        $attribute = $customerSetup->getEavConfig()->getAttribute('customer', 'client_idn');
        $attribute->setData('used_in_forms', ['adminhtml_customer', 'customer_account_create']);
        $attribute->save();

        $setup->endSetup();
    }

}

In database, the records are successfully inserted.

However, the custom attribute does not show up in the registration form.

Is there anything wrong?


texts: Magento 2.2 data migration Duplicate store_group_name Entries

texts:
I am trying to migrate a store from 1.9.2.2 to Magento 2.2 using the Magento data migration tool but unfortunately when running the tool the error appears

  [PDOException]
      SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'default' for key 'STORE_GROUP_CODE'

As I understand

STORE_GROUP_CODE is a new column added in Magento 2.2
It is generated from column STORE_GROUP_NAME which in Magento 2.X is found in table STORE_GROUP

In Magento 1.9.2.2 column STORE_GROUP_NAME is located with table CORE_STORE_GROUP

from within the Magento 1.9.2.2 database

so migration is failing because of the duplicate entries.

The default Value for website_id 0 (admin) should be 'default'
The default value for website id 1 (base) should be 'Main Website Store'

Unfortunately, both my store_group_names are the default.

As an experiment I change Store_Group_Name for website 1 (base) to 'Main Website Store' and data migration ran no problems.

Everything worked until I reindex the result was

Frontend: When viewing the store (on a clean luma 2.2 installations) the add to cart buttons are missing
Backend: All products show in list view but if you click one product it loads with the error: Unable to unserialize value

Does anyone know how I can change the Store_Group_Name website id 1 (base) without breaking the database


texts: Magento 1.9 removing back slashes while saving a file path to DB

texts:
Here is the query in controller to save an uploaded file path from a custom directory to database custom table but it is not including the actual page query removed the slashes and the add plain string in to database table

$connectionresource = Mage::getSingleton('core/resource');
        $connectionWrite = $connectionresource->getConnection('core_write');
        $prefix = Mage::getConfig()->getTablePrefix();
        $table = 'magesf_ordercustom';
        $query = "insert into ".$prefix.$table." "
             . "(order_id,image_url,image_comments,customer_id) values "
             . "('$orderid', '$paths', '$attach_comments','$order_cus_id')";

        $binds = array(
          'order_id'    => $orderid,
          'image_url'   => $paths,
          'image_comments' => $attach_comments,
          'customer_id' => $order_cus_id,

        );

        $connectionWrite->query($query, $binds);

Actual path should be like this:

c:/xampp/htdocs/magento_dev/media/customer_documents/error.png

But it is saving as:

C:xampphtdocsmagento_devmediacustomer_documentserror.png

What is the issue with query is there any default behaviour of Magento?

Please guide.


texts: Place order error Message queue topic "inventory.reservations.updateSalabilityStatus" is not configured. in magento 2.3

texts:
when i click place order button i get this message

Message queue topic "inventory.reservations.updateSalabilityStatus" is
not configured.

and order has place in backend but i still get this message always


texts: I have set my homepage layout to 2 columns with right sidebar what i want to do is, I want to put a block just above the footer of my homepage in such a way that it will cover full width of the page. Currently, I can't achieve that because my homepage is 2 columns with right sidebar, so it obviously leaves space at right part. Is there any way I can define block in my homepage which will cover full width? or any link which is helpful to proceed?


texts: How to override the square extension on the checkout page?

texts:
Im trying to customize the

public_html/vendor/square/module-squareup-omni/view/frontend/web/template/payment/square.html

I made override, but it doesn't work

/public_html/app/design/frontend/Vendor/Theme/Square_Connect/web/template/payment/square.html

I cleared the cache and dicompiled, it didnt help.


texts: How Magento Controller-Block-Layout-Templates work together

texts: How Magento's controller action which is C from MVC, Block-Layout-Template which is V from MVC and Collections-Helpers which is M from MVC work together to show custom data from a mysql table. It's a confusing concept for someone who is new to magento. Any help would be appreciated. Thanks.


texts: Why module go to vendor directory if install using composer Magento2?

texts:
Can anyone please tell me the reason why module go to Vendor directory when install using composer?

Please refer me a link for this reason.

In my custom extension, I am using this code in my composer file.

{

"name": "vendor/module",
"description": "Magento 2 Shipping Rates",
"type": "magento2-module",
"version": "1.0.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {},
"authors": [
{
  "name": "ABC",
  "email": "abc@mail.com",
  "homepage": "abc.com",
  "role": "Owner"
}
],
"autoload": {
"files": [ "registration.php" ],
"psr-4": {
  "Vendor\\Module\\": ""
}
},
"minimum-stability": "dev",
"prefer-stable": true
}

Also, I have configured Github and Packagist too.
But when I try to install my module using composer by using command

  composer require vendor/module

I am getting this error message.

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package vendor/module * is satisfiable by vendor/module[dev-master] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.


texts:
I try to convert my custom Object to Array.

Here my Object :

Namespace\Project\Model\Custom\Object Object
(
    [attr1:protected] => value1
    [attr2:protected] => value2
    [attr3:protected] => value3
)

Here, my code to convert :

protected function objectToArray($object)
{
    if (!is_object($object) && !is_array($object)) {
        return $object;
    }
    return array_map(array($this, "objectToArray"), (array) $object);
}

But the result is :

Array
(
    [ * attr1] => value1
    [ * attr2] => value2
    [ * attr2] => value3
)

I don't understand why * appear in my array key... Any suggestion to remove them ? If possible when I create the array, not after.


texts: What are some simple custom modules to play with Magento 2?

texts:
I'm learning Magento 2 modules. I would like to create custom modules from beginner level to advanced.

Can you please tell me what are simple concepts that can be created as a module in Magento 2?

Also, Is it possible to create price slider in category page without using any extension?

Looking your valuable comments and answer.


texts: How to change the layout of the all products page?

texts: Can anyone tell me where I can change the layout of the all products page? I think this page is now having 3columns.phtml layout but I need 2columns-left.phtml layout.


texts:
I  have upgrade magento from 2.1.11 to latest version 2.2.3

After complete upgrade some issues with website display:

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Please update your modules: Run "composer install" from the Magento root directory.
The following modules are outdated:
Magento_Customer db data version: defined in codebase - 2.0.12, currently installed - 2.0.9
Mageplaza_Smtp db schema version: defined in codebase - 1.1.0, currently installed - 1.2.0
Mageplaza_Smtp db data version: defined in codebase - 1.1.0, currently installed - 1.2.0

When I try run

php bin/magento setup:upgrade

Then get error: "sorry something went wrong...."

Log exception file:

[2018-04-08 09:19:51] main.CRITICAL: Asymmetric transaction rollback. {"exception":"[object] (Exception(code: 0): Asymmetric transaction rollback. at /home/b2b/domains/b2bstyle.pl/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:316)"} []
[2018-04-08 09:20:03] main.CRITICAL: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: DELETE FROM catalog_category_product_index_replica {"exception":"[object] (Magento\Framework\DB\Adapter\DeadlockException(code: 1213): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: DELETE FROM catalog_category_product_index_replica at /home/b2b/domains/b2bstyle.pl/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:555, Zend_Db_Statement_Exception(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: DELETE FROM catalog_category_product_index_replica at /home/b2b/domains/b2bstyle.pl/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /home/b2b/domains/b2bstyle.pl/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []
[2018-04-08 09:31:03] main.CRITICAL: Dotmailer connector API endpoint cannot be empty. {"exception":"[object] (Magento\Framework\Exception\LocalizedException(code: 0): Dotmailer connector API endpoint cannot be empty. at /home/b2b/domains/b2bstyle.pl/public_html/vendor/dotmailer/dotmailer-magento2-extension/Model/Apiconnector/Client.php:118)"} []
[2018-04-08 09:32:15] main.CRITICAL: Asymmetric transaction rollback. {"exception":"[object] (Exception(code: 0): Asymmetric transaction rollback. at /home/b2b/domains/b2bstyle.pl/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:316)"} []
[2018-04-08 09:43:04] main.CRITICAL: Asymmetric transaction rollback. {"exception":"[object] (Exception(code: 0): Asymmetric transaction rollback. at /home/b2b/domains/b2bstyle.pl/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:316)"} []


texts: How to show promotional Label using custom attribute in backend

texts:
I want a custom attribute where If we write anything like "FREE INSTALLATION" It will show on Frontend Product Listing...

Can anyone help me in this?


texts: Store view switch does not work right when i am in products category and changing the store language

texts:
Now let's explain the problem better.

I have a magento e-shop with 2 store views, i have created two main menus for each store view.

Everything works fine when i am at the home page and change the store view to the english one.
And also the other way around, from English to greek.

But when i am in a category from the menu and try to change the language i get no results because the path that i see is not right.

And what i mean by that, let's say for example that i am in the t-shirts category in the greek store view the path that is displayed below the menu says:

Home(in greek)->Products(in greek)->t-shirts(in greek)

and when i change the language i see the following menu which is wrong:

Home(in english)->Products(in greek)->t-shirts(in greek)

and of course it does not return any results. What i have done wrong here and how i can solve it?


texts: Change product image for configurable products

texts:
I was looking for a way that let me change the product image based on the attribute selected for the configurable product. e.g.

Configurable Product With Color Options  :  1) Red 2) Green

If the Red is selected by user is should change the main image on the details page with the one from associated products.

I have looked over this one Simple Configurable Product

But in the reviews some one is saying that image changing is not working also this is adding and extra functionality for pricing based on associated products this is not what i was thinking.

Any one having any idea how this can achieve without having to put too much work.
Thanks.


texts:
I've managed to create an Observer to automatically create a shipment when an invoice is created.

The problem I have is with the final part of the code to send the email once the shipment has been created.

I wanted to ask if anyone can notice what is wrong with the $sendEmail call in my code.

Here's my Observer code for _saveShipment()

        protected function _saveShipment(Mage_Sales_Model_Order_Shipment $shipment, Mage_Sales_Model_Order $order, $customerEmailComments = '')
        {
            $shipment->getOrder()->setIsInProcess(true);
            Mage::log($shipment->debug(),Zend_Log::INFO,'shipment.log',true);
            $transactionSave = Mage::getModel('core/resource_transaction')
                ->addObject($shipment)
                ->addObject($order)
                ->save();

            $emailSentStatus = $shipment->getData('email_sent');
            if($emailSentStatus)
                Mage::log("Email has been sent",Zend_Log::INFO,'email.log',true);
            else
                Mage::log("IS FALSE",Zend_Log::INFO,'email.log',true);
//                Mage::log($customerEmailComments,Zend_Log::INFO,'email.log',true);
            if (!is_null($customerEmail) && !$emailSentStatus) {
                $shipment->setEmailSent(true);
                $shipment->sendEmail(true, $customerEmailComments);
            }

            return $this;
        }

Thanks for you time...


texts: Catalog Price Rules mess when using multiple conditions

texts:
I'm trying to set up some discounts on manufacturers products, but I need to be able to apply different discounts on some categories.

Example:
If manufacturer: ford, discount is 25%
If manufacturer: ford and Category: services, discount is 45%

Now, if I create such rules, then I get a discount of 59% for products on category Services and some of the products with manufacturer: ford don't have any discount at all.

I've also tried:
Manufacturer: ford, category not services, discount 25
Manufacturer: ford and Category: services, discount is 45

This works a bit different, I still get a few products without any discounts but the products that get the 45% discount are rounded up and the discount might get up to 47% automatically.

This is all a mess lol. Any ideas?

Thanks.


texts: magento 2 css and js styles not working when accessed remotely but works internally

texts:
I setup magento 2.2.0 in developer mode to work via dev.example.com internally by setting up magento with nginx and then doing host overrides in the firewall. Everything works great locally.

Next i setup NAT in the firewall so that someone could hit the dev site remotely by going to <publicIP:PORT>. At first each time they visited the site remotely, it would try to redirect to example.com which of course we don't own so that didn't work. Next i went in the magento dev interface Stores>Configuration>Web>"Url Options" and set "auto-redirect to Base URL" to "NO". It was set to use system value which was "Yes 302 Found".

After making that change and doing a cache flush under "System>Cache Management", now external access from <public IP:PORT> is working and not redirecting, but css/js isn't working. There is no styling.

In the console I have

Uncaught SyntaxError: Unexpected token <            require.js:1
Uncaught SyntaxError: Unexpected token <            mixins.js:1
Uncaught SyntaxError: Unexpected token <            requirejs.config.js.js:1
Uncaught TypeError: require.config is not a function            <publicIP>/:145 at <publicIP>/:145

All internal access is still working perfectly via dev.example.com for both admin and store front. It's just external that has this problem after making the above change to prevent a request from <publicIP:PORT> from redirecting to the domain since that domain only works internally.

After trying to flush the cache again I also have the following in the console with remote request in addition to the other error messages above:

Resource interpreted as stylesheet but transferred with MIME type text/html: "http://dev.example.com/?f"

Which tells me that the redirect setting i turned off doesn't apply to styles.

How do you correct the error above so that access remotely works via the IP and still has styling?


texts: How to get product finder collection on the catalog search page using search keyword in magento?

texts:
I want to get the collection of Product Finder data

  (make, model, series, sku)

from product finder admin grid based on search keyword.

For now, Products and categories are searched using the keyword, but I don't know how to display the data from product finder on the basis of the search keyword.

If anyone has Idea, please suggest.


texts: Price Tier for Magento Custom Option Input - text field by its Length

texts:
In Magento 1.9,

I would like the product price to update ONLY when customer input more than 5 characters (or multiple the change-price for every 5 character added, if not too complex).
* The "price change Value" is set via the backend custom option, as below

I want to add if-else to decide the onchange event, but fail to get current user input length.
file: ..\app\design\frontend\base\default\template\catalog\product\view\options\type\text.phtml

<input type="text" onchange="opConfig.reloadPrice()" id=...>

Can anyone help? Thanks in advance!


texts: select product details page options if dropdown has one value in Magento 2.1

texts:
I want to select the options in each dropdown in product details page if it has one option.
for example

dropdown : 1 (option)
dropdown : 2 (option)
dropdown : 1 (option)

Then on the selection of the first drop down, the second drop down will be active for selection and when we select an option from the second drop-down then if the third drop down has only one option then it has to be selected as default


texts: Is there any way to run one file and fire multiple magento2 command in Ubuntu?

texts:
Is there any way to run one file and fire multiple magento2 command like
Index, static content, deploy, cache clear etc. And for all files permissions set Automatically.


texts:
I'm creating a CRUD module for Magento2 with an EAV entity.
My first step is to install and uninstall the module.
My EAV entity is similar to products, categories and customers.
The install script works as the install from the customer module.
It adds the _int, _decimal, ... tables and some rows in eav_entity_type and eav_attribute tables.

How can I trigger in my uninstall script the delete of these rows without running a raw query like DELETE FROM eav_entity_type WHERE ...?
Actually I need to delete something only from the eav_entity_type because the values from eav_attribute should cascade.

My uninstall script follows standards.
I have the file in Setup/Uninstall.php and it contains the method

public function uninstall(
    \Magento\Framework\Setup\SchemaSetupInterface $setup,
    \Magento\Framework\Setup\ModuleContextInterface $context
) {
   ....
}

The method gets called so this I've done right.


texts:
When getting an error page, there is always a line at the beginning of the file, that states where the error happened, for example:

a:5:{i:0;s:172:"Cannot send headers; headers already sent in path/to/the/file/Sales/Order/Pdf/Items/Invoice.php, line 1";i:1;s:1539:"

or

a:5:{i:0;s:25:"No date part in '' found.";i:1;s:6372:"#0 path/to/the/file/code/core/Zend/Date.php(1091): Zend_Date->_calculate('set', false, NULL, 'en_US')

What exactly do these i:0;s:25, i:0;s:172:, i:1;s:6372, i:1;s:1539:,  parts mean?


texts: Porto theme - product page type looks broken

texts:
I am sorry for that question, but I am new to Magento and although I was hired as Junior Wordpress Developer I have more or less senior position (except for the salary) and nobody in the company is able to guide me, help me, basically I was hired as a Junior, but I apparently have the biggest knowledge there.
So, I have the Magento 2.3 website, which seems to have a lot of bugs, from what I noticed it was upgraded from some older version of Magento and somebody who did that did not clear the mess.
I managed to fix some issues, but some other seem to be really hard to fix and because of my lack of former knowledge in Magento I am not even sure where to look.
I read all the docs and examples of official Porto theme and from what I saw, when I change  "product page type" to default it should just look like in the demo stylewise/functionwise. It doesn't. Every product page type I choose looks totally broken, like no thumbnail at all, strange behaviour of zooming the pictures except for the grid one, which also looks much different that it should.
There are no errors in console.
What issue might be causing that? How can I debug this?


texts:
I am new to Magento. I have following code in a template file called brand.html

$brandImageUrl = $this->getBrandImageUrl($brand);

My understanding (roughly) is that $this refers to an instance of the block created by brand.html

Basically the image path returned by that method refers to an image that is too small and I would like to know where this method is is implemented so I can modify it to give me a path to a larger image. The image in question is a brand logo, currently at 40x19 pixels, which is too small.

Any pointers in the right direction are very welcome. Also general information for Magento newbies is welcome.

P.S. I have been programming for many years in many languages on many systems, but Magento is baffling me.


texts:
I am using a module to process product returns, but unfortunatly the comment field is not required. I would like to add the check that people have to fill out WHY they return the product.

As far as I can find it should be in this bit of code:

        if ($p_qty == true) {

        $rma->save();

        //set sub products information
        foreach ($rmaProducts as $rmaProduct) {
            $id = $rmaProduct->getitem_id();

            //check
            if (isset($data['rp_qty_' . $id])) {
                $qty          = $data['rp_qty_' . $id];
                $description  = $data['rp_description_' . $id];
                $reason       = $data['rp_reason_' . $id];
                $request_type = $data['rp_request_type_' . $id];
                $rma->updateSubProductInformation($rmaProduct, $qty, $description, $reason, null, $request_type);
            }

        }

        //notify admin
        $rma->NotifyCreationToAdmin();

        //confirm & redirect
        Mage::getSingleton('customer/session')->addSuccess($this->__('Product Return successfully sent.'));
        $this->_redirect('ProductReturn/Front/View', array('rma_id' => $rma->getId()));
    } else {

        Mage::getSingleton('customer/session')->addError($this->__('Please select quantities to return.'));
        $this->_redirect('ProductReturn/Front/NewRequest', array('order_id' => $data['rma_order_id']));
    }

Is there a easy way to edit this and make the rp_reason mandatory?


texts:
How to remove white background from product images in Magento 2.2.6?
Please check this screenshort


texts:
I'm trying to import a lot of Products from my old Shop and therefor I need your help.

My items have a "parent" item which was necessary for my old Shop.

Example:

-T Shirt Batman
--T Shirt Batman Size 6
--T Shirt Batman Size 8
--T Shirt Batman Size 2

I can add every child and parent product into Magento with a PHP Script. Every child needs to have a stock quantity and an own price.

I 've read somewhere that a configurable product is what I'm looking for, because the sizes should be selected by dropdown. Is this correct?

Can you help me:
- Is it enough to declare the Patent product as configurable and assign child products? If yes, how?

Am I completly wrong and have to take another way?


texts: Varien_Http_Client: getQuery() returns nothing

texts:
I'm trying to use Varien_Http_Client for calling external API, here's the code:

    $httpClient = new Varien_Http_Client();
    $httpClient->setUri('https://api-host/api/endpoint');
    $httpClient->setMethod(Zend_Http_Client::GET)
    $httpClient->setParameterGet([
        'name' => 'John',
        'gender' => 'male',
    ]);

    $params = $httpClient->getUri()->getQuery();

The problem is $httpClient->getUri()->getQuery() returns nothing if I set the GET parameters using setParameterGet() like above, shouldn't it suppose to return name=John&gender=male?

Updated: getQuery() after calling request, getting same result

    $httpClient = new Varien_Http_Client();
    $httpClient->setUri('https://api-host/api/endpoint');
    $httpClient->setMethod(Zend_Http_Client::GET)
    $httpClient->setParameterGet([
        'name' => 'John',
        'gender' => 'male',
    ]);

    try {
        $response = $httpClient->request();
        Mage::log($httpClient->getUri()->getQuery());
    } catch (Exception $e) {
        Mage::log($e);
        return $e;
    }

One more thing, it works if I set the parameters this way

$httpClient->setUri('https://api-host/api/endpoint?name=John&gender=male');


texts: Regarding currency conversion error INR and USD

texts: I have a problem with currency convert, my base currency is Indian Rupee and i mapped Indian Rupee and [USD] to the site. Currency rates also given correctly. While i changed INR to USD its showing wrong prices in the site at category page and product page, in check out page its showing correct value. Thank you


texts: Home page seller products are displaying above slideshow container

texts:
I have installed SUPEE-6788 using SH. And used ecommerce extension to display new, topseller, toprated, popular products.. But all those products are displaying above slideshow.. How to move it below that container..

To display the products it is making a call to data.phtml.
But i have tried renaming to someother name and calling all those files through admin->homepage. Before updating with SUPEE-6788 it was working fine.. But after installing magento 1.9.2.2 it is making call to data.phtml. How to call it through magento adminhome page

I have used below code to make a call instead of data.phtml

{{block type="homepage/topsell"  category_id="" template="ecommerceoffice/homepage/topsell.phtml"}}
{{block type="homepage/new"  category_id=0 template="ecommerceoffice/homepage/new.phtml"}}
{{block type="homepage/popular"  category_id=0 template="ecommerceoffice/homepage/popular.phtml"}}
{{block type="homepage/toprated"  category_id=0 template="ecommerceoffice/homepage/toprated.phtml"}}


texts:
I write you because I am trying to create a shopping cart rule that applies a discount to a bundle of materials (2 different materials in each BOM) if the user places more than 10 bundles in the basket.

What I did is creating a discount that only applies if quantity of material 1 and the quantity of material 2 are both above 10 (material 1 and material 2 form the bundle).

So far everything was working but now I have an additional material that I would like to include in the action discount. This material (material 3) is not part of any bundle but I would like to have an action that says: "if the total quantity in the basket is above 10 (e.g. 5 bundles and 5 material 3), then apply discount".

The only solution that I found so far was to state all the different combinations of quantity but I found out that Magento has a limited amount of rows of formulas :)

  Material 1 > 1; Material 2> 1; Material 3 > 9

  Material 1 > 2; Material 2> 2; Material 3 > 8

  Material 1 > 3; Material 2> 3; Material 3 > 7

  Material 1 > 4; Material 2> 4; Material 3 > 6

  Material 1 > 5; Material 2> 5; Material 3 > 5

  Material 1 > 6; Material 2> 6; Material 3 > 4

I think there should be a better way to do it.


texts: Magento 2 order REST Api append Custom Attribute

texts: I want to get Custom Attribute value which is already saved in database table, i just want to append it to my Sales order REST APi, i have tried adding extension attribute , i am able to get set and get functions in generation file , how do i show my custom attribute in my REST Api


texts:
According to this guide http://docs.magento.com/m2/ee/user_guide/marketing/google-tag-manager.html
there should be some options in magento2 2.2.2 to choose google tag manager instead of just google analytics, but in my Magento 2.2.2, I can only choose Google analytics, under store->configuration->sales->Google API->Analytics
I guess I need to install some additional feature, since I upgraded from 2.1.9 to 2.2.2?


texts:
What is the best way to change the currency's precision?

I have a store that uses Euro as the currency, but I want to change the precision from 2 decimal places to 3.

I know that the locale data is stored under /lib/Zend/Locale/Data but is this really the best place to change this sort of information.


texts: How can I regenerate vendor/magento/module-directory/etc/config.xml?

texts: I am making changes in my store configuration. They are changing in the database but they don't actually appear in the frontend. It appears this file- vendor/magento/module-directory/etc/config.xml is overriding them. Can I regenerate that file based off what is in the database?


texts:
*This is a beginner's question in phpunit so i don't know if it belongs here or not.

I want to test that the var path is correct, but I'm getting Failed asserting that null matches expected '/magento2/var'.

I suppose because I am using a mock for DirectoryList, instead instantiating the class. How does one test it? Should I instantiate DirectoryList? I am having issues with it's constructor...

<?php

namespace Vendor\Module\Cron;

use Magento\Framework\App\Filesystem\DirectoryList;

class Products {

    /**
     * Retrieve var path
     *
     * @return string
     */
    protected $directory_list;

    public function __construct(
        DirectoryList $directory_list
    )
    {
        $this->directory_list = $directory_list;
    }

    /**
     * Retrieve var path
     *
     * @return string
     */
    public function getVarFolderPath()
    {
        return $this->directory_list->getPath('var');
    }
}

and my test:

<?php

namespace Vendor\Module\Test\Unit\Model;

use Magento\Framework\App\Filesystem\DirectoryList;
use Vendor\Module\Cron\Products;

class ProductsTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var string
     *
     * dummy var path
     */
    const VAR_PATH = '/magento2/var';

    /**
     * @var Vendor\Module\Cron\Products;
     */
    protected $products;

    /**
     * setup tests
     */
    protected function setUp()
    {

        /** @var \PHPUnit_Framework_MockObject_MockObject|DirectoryList */
        $directoryListMock = $this->getMockBuilder(DirectoryList::class)
            ->disableOriginalConstructor()
            ->getMock();
        $this->products = new Products(
            $directoryListMock
        );
    }

    /**
     * @test Vendor\Module\Cron\Products::getVarFolderPath()
     */
    public function testGetVarFolderPath()
    {
        $this->assertEquals(self::VAR_PATH, $this->products->getVarFolderPath());
    }
}

Update: so Kandy's answer was ok. in unit test you test just that specific class.


texts:
Trying to add some custom JS to my module. The file is called in the <head> section, but theres no code in the file called.

/view/frontend/web/js/fitmentsearch.js

define([
  "jquery"
],
function($) {
  "use strict";

  // Here your custom code...
  console.log('Hola');

});

/requirejs-config

var config = {

  // When load 'requirejs' always load the following files also
  deps: [
    "js/fitmentsearch"
  ]

};

default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="EkkoMedia_FitmentSearch::css/fitmentsearch.css" />
        <script src="EkkoMedia_FitmentSearch::js/fitmentsearch.js"/>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-nice-select/1.1.0/js/jquery.nice-select.min.js" src_type="url" />
    </head>
    <referenceContainer name="header.container">
        <container name="header.containertwo" as="header_containertwo" label="Page Header Container"  htmlTag="div" htmlClass="header-fitmentsearch" before="-"/>
</referenceContainer>
<referenceContainer name="header.containertwo">
        <block class="Magento\Framework\View\Element\Template" name="header.mini.container" template="EkkoMedia_FitmentSearch::test.phtml"/>
    </referenceContainer>
</page>


texts:
I am overriding Usa\Model\Shipping\Carrier\Ups.php but its not working.
i want update this function collectRates()
code below

what's the problem

app/etc/modules/TechnikExpert_Usa.xml
<?xml version="1.0"?>
<config>
  <modules>
    <TechnikExpert_Usa>
      <active>true</active>
      <codePool>local</codePool>
    </TechnikExpert_Usa>
  </modules>
</config>

app\code\local\TechnikExpert\Usa\etc\config.xml
<?xml version="1.0"?>
<config>
  <modules>
    <TechnikExpert_Usa>
      <version>0.1</version>
    </TechnikExpert_Usa>
  </modules>
  <global>
    <models>
      <usa>
        <rewrite>
          <shipping_carrier_ups>TechnikExpert_Usa_Model_Shipping_Carrier_Ups</shipping_carrier_ups>
      </usa>
    </models>
  </global>
</config>

app\code\local\TechnikExpert\Usa\Model\Shipping\Carrier\Ups.php

<?php
 class TechnikExpert_Usa_Model_Shipping_Carrier_Ups extends Mage_Usa_Model_Shipping_Carrier_Ups
{

    const CODE = 'ups';

    /**
     * Delivery Confirmation level based on origin/destination
     *
     * @var int
     */
    const DELIVERY_CONFIRMATION_SHIPMENT = 1;
    const DELIVERY_CONFIRMATION_PACKAGE = 2;

    /**
     * Code of the carrier
     *
     * @var string
     */
    protected $_code = self::CODE;

    /**
     * Rate request data
     *
     * @var Mage_Shipping_Model_Rate_Request|null
     */
    protected $_request = null;

    /**
     * Raw rate request data
     *
     * @var Varien_Object|null
     */
    protected $_rawRequest = null;

    /**
     * Rate result data
     *
     * @var Mage_Shipping_Model_Rate_Result|null
     */
    protected $_result = null;

    /**
     * Base currency rate
     *
     * @var double
     */
    protected $_baseCurrencyRate;

    /**
     * Xml access request
     *
     * @var string
     */
    protected $_xmlAccessRequest = null;

    /**
     * Default cgi gateway url
     *
     * @var string
     */
    protected $_defaultCgiGatewayUrl = 'http://www.ups.com:80/using/services/rave/qcostcgi.cgi';

    /**
     * Default urls for XML
     *
     * @var array
     */
    protected $_defaultUrls = array(
        'Rate'        => 'https://onlinetools.ups.com/ups.app/xml/Rate',
        'Track'       => 'https://onlinetools.ups.com/ups.app/xml/Track',
        'ShipConfirm' => 'https://onlinetools.ups.com/ups.app/xml/ShipConfirm',
        'ShipAccept'  => 'https://onlinetools.ups.com/ups.app/xml/ShipAccept',
    );

    /**
     * Container types that could be customized for UPS carrier
     *
     * @var array
     */
    protected $_customizableContainerTypes = array('CP', 'CSP');

    /**
     * Collect and get rates
     *
     * @param Mage_Shipping_Model_Rate_Request $request
     * @return Mage_Shipping_Model_Rate_Result|bool|null
     */

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
         die('function called');
    }
}


texts: Use category names, urls and description from another store

texts:
I have 1 default store view in danish and 2 additional store views in english, one of which I have just created. This new english store view is (obviously) using my names, descriptions and urls for the categories from the default danish store view.

However, I would like to change all categories in this store view to use the information from the same categories in my existing english store view.

So - how can I make one store view's categories use information from another store view instead of the default?


texts:
we have multi store views site.

we provide an option to change store views through dropdown here as below :

once we change option from dropdown, it will display selected store view.

but once we click on any other page[ menu, catalog, Product ,cms ] it will again display old store view.

but it should be in same store view until we change it manually.

Is i need  to use cookies for saving ?

observer.php

class Atwix_Ipstoreswitcher_Model_Observer
{
    /**
     * redirects customer to store view based on GeoIP
     * @param $event
     */
     public function controllerActionPostdispatch($event)
    {

      if(!empty($_GET['___from_store']))
      {
          Mage::app()->setCurrentStore($_GET['___store']);
      }
      else
      {
       $geoIP = Mage::getSingleton('geoip/country');
        $cnCode =  $geoIP->getCountry();
       // echo $cnCode;
       // echo $cnCode='IN';
            switch ($cnCode) {
                case "US": {
                      Mage::app()->setCurrentStore('india');
                      break;
                }
                case "IN": {
                    Mage::app()->setCurrentStore('india');
                    break;
                }
                case "CA": {
                    Mage::app()->setCurrentStore('india');
                    break;
                }
                case "UK": {
                    Mage::app()->setCurrentStore('india');
                    break;
                }

                case "AU": {
                    Mage::app()->setCurrentStore('india');
                    break;
                }
          }

        }

    }
}

language.phtml

<?php if(count($this->getStores())>1): ?>
<?php
$lis = "";
$selCurrency = $this->__('Currency');
foreach ($this->getStores() as $_lang):
    if($_lang->getId() == $this->getCurrentStoreId()){
        //This line will show SYMBOL only
        //$selCurrency = "[".Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol()."]";

        //This line will show FULLNAME
        $selCurrency = '  '.$this->escapeHtml($_lang->getName());
    }
    $lis .= '
getCurrentUrl().'">'.$this->escapeHtml($_lang->getName()).'
';
endforeach;
?>

    <ul id="select-language" title="<?php echo $this->__('Currency') ?>" class="dropDownMenu">

<?php echo $selCurrency ?>

            <?php echo $lis ?>

<?php endif; ?>


texts: Get state from address in custom shipping method on OneStepCheckout

texts:
So we are running Magento CE 1.9.0.1 and are mid-way through developing a custom shipping module as we have largely different shipping costs than the traditional shipping can cover.  We are also using a OneStepCheckout plugin for the checkout process.

OneStepCheckout plugin: http://www.mage-world.com/magento-one-step-checkout-extension.html

Custom shipping module: http://www.smashingmagazine.com/2014/01/create-custom-shipping-methods-magento/

We need to be able to detect the state that the user (customer) is shipping to as we need to charge extra for shipping to Hawaii, Alaska and Puerto Rico.  We also have some additional logic in the shipping module that detects $100 and day of the week, all of which work well.

So in the shipping module:

/app/code/local/CustomShipping/MyCarrier/Model/Carrier.php

We access the cart total like this:

$cartTotal = Mage::getSingleton('checkout/session')->getQuote()->getGrandTotal();

However no "state / region" element exists in that part (obviously).

We have the OneStepCheckout (OSC) refresh the shipping change on address selection (ajax) which to me should signify that there is an object somewhere in the magento stack that contains the updated address info including the state that I can use in the module to refresh the shipping options, I just can't find it.

We are aware that on the initial load, the shipping options will be the "default" ones and that they need to update once they select their shipping state.

Help?  Can someone help me find where to get the state/region from the checkout/cart object?


texts:
Sure I am missing some point.
I change the any style in style.css

  pub\static\frontend\author\theme\en_US\css

And when I refresh Magento 2 site, all styles are revert back to default values.

how can I change the color and font-family?


texts: How to add multiple products to a cart in related products grid on product detail page using Qty Box?

texts: I want to add Qty box in related products. It works when I add any related product but I need to add multiple product at a time so what should I do ?


texts: Magento get all products details in json format

texts: I am using magento 1.9.3 version.  I got the specific products details in json format. Now i want show all the products details in json format.   I referred some more sites, There is not examples of these problem .


texts: Why I cannot switch into given mode "develop"?

texts:
I use this basic environment Docker, with Magento 2.1. When I was tried to change the deploy mode, the terminal shows me:

  Cannot switch into given mode "develop"

The permission's ok, and I had tried with bin/magento and magerun2.


texts: Magento 1.9: upload product image from external URL programmatically

texts:
We have created products programmatically. Also, need to fetch the image from below URL
http://www.diamondselections.com/Embed/client_assets/images/round@2x.png


texts: Magento 2 - Create New Theme based on the blank theme

texts:
I'm new to Magento
I try to create a new theme based on the Magento blank theme
and I follow the Frontend developer guide in Magento web site but I could not inherit from Magento/blank and when I open the site it wants to load the CSS and javascript
I create these folders and files
TestVender/
└── TestTheme
    ├── etc
    ├── media
    │   └── TestPreview.jpg
    ├── registration.php
    ├── theme.xml
    └── web
        ├── css
        ├── images
        └── js

and theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>Test Theme</title> <!-- your theme's name -->
     <parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
     <media>
         <preview_image>media/TestPreview.jpg</preview_image> <!-- the path to your theme's preview image -->
     </media>
 </theme>

and registration.php
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/TestVender/TestTheme',
    __DIR__
);

and I add this to
\var\www\html\magento\dev\tools\grunt\configs\themes.js

themename: {
        area: 'frontend',
        name: 'TestVender/TestTheme',
        locale: 'en_US',
        files: [
            'css/styles-m',
            'css/styles-l'
        ],
        dsl: 'less'
    },

could anyone help me to solve the problem?
and this is how my page look like when I open it


texts: How to Comment Out a Subcategory Link in Magento's Default Sidebar

texts:
This is my first post here!

I'm only posting this question because I have researched but cannot find the answer I need here or anywhere else.

So, I'm trying to simply comment out a specific Subcategory link in the default sidebar of a Magento site.

And I need to do this from the Magento Admin panel without digging into the code if possible.

I only want people who have the link to be able to get to the page. So this is why I don't want it showing up in the sidebar.

If this requires an extension, please let me know.
Or if this can only be done by getting into the code. Just let me know. I read somewhere the following is how you do it:

  /app/design/frontend/default/YOUR_THEME/template/page . At around line
  50 you'll see the <div class="col-left sidebar"> line.

Ideally, I'd like to log into the Magento Admin area > find sidebar links > comment out the above indicated link.

If you need any more details please let me know.

Thanks in advance!


texts: How to get the price of a product for each store view?

texts:
I have created a custom tab in the product admin.

I have multiple input fields there and I want the values of them to be the price of the product for each store view.


texts: Meigee Widget code 1.9.1.2 not displaying correctly

texts:
I noticed after installing the new security patch my homepage products blocks disappeared. I removed this code which pulled the New products to the home page, however this code blocks all other codes and when I try adding a new widget the size of the blocks are too small

{{widget type="catalog/product_widget_new" display_products="all_products" show_paginator="0" products_per_page="6" products_count="6" column_count="6" template="catalog/product/widget/new/content/new_grid.phtml"}}


texts: Magento 2 install package with composer without SSL

texts:
I am trying to install a package

composer config repositories.swissup composer http://swissup.github.io/packages/

Which result in this error

  Your configuration does not allow connections to http://docs.swissuplabs.co
  m/packages/packages.json. See https://getcomposer.org/doc/06-config.md#secure-http

The same if I change the URL to HTTPS.
Also this Magento installation hast no SSL certricate yet, so maybe its vene that.

So, how can I install it without HTTPS?


texts: Get skin resource path or url for set package and theme

texts:
I'm trying to get the header logo image and having some issues.. I keep getting the base/default package/theme instead of what is set as the package and theme for skin in the admin. Here is some code I've tried:

require 'app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::app()->loadArea('frontend');
$layout = Mage::getSingleton('core/layout');
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();

//both of these are giving me base/default
echo $layout->getBlock('header')->getLogoSrc() . '<br/>';
echo Mage::getDesign()->getSkinUrl('images/logo.png');

I'm getting /skin/frontend/base/default/images/logo.png
But I'm expecting /skin/frontend/myPackage/myTheme/images/logo.png

In system config > Design, I have the "Current Package Name" set to "myPackage" (under Package), and Templates, Skin, and Layout set to "myTheme" (under Themes).


texts: Wrong group_id when trying to programmatically adding group to customer

texts:
I created a module in order to add a group to a customer depending on his profession (I added a field where he can choose between different professions).

<?php

class Solumed_Customer_Model_Customer_Observer extends Mage_Core_Model_Abstract
{
    /*
     * observer for the customer saved event
     */
    public function customer_save_before($observer)
    {
        try {
            $customer = $observer->getCustomer();

            switch ($customer->getProfession()) {

                case 4:
                    $customer->setData('group_id', 4);
                    break;

                case 5:
                    $customer->setData('group_id', 5);
                    break;

                case 6:
                    $customer->setData('group_id', 6);
                    break;

                case 7:
                    $customer->setData('group_id', 7);
                    break;

                case 8:
                    $customer->setData('group_id', 8);
                    break;

                default:
                    # code...
                    break;
            }
        } catch (Exception $e) {
            Mage::log( "customer_save_before observer failed: " . $e->getMessage() );
        }
    }
}

?>

The problem is that, after creating a new customer, the group doesn't match the chosen profession. For instance, when I create a doctor (group id number 6), the customer group is not "doctor" but something else (nurse).

I tried to see what the code below give when adding a customer so I wrote this code:

$group = Mage::getModel('customer/group')->load(6)->getCustomerGroupCode();

It returns 'doctor' so I don't know where I am wrong.


texts: I was wondering how some am I not able to have more than 1 item in my wishlist. Whenever I add a new one, the old one gets replaced. I am on magento 1.9.1


texts: Magento 2: Save custom customer attribute value programmatically

texts:
How can I save a custom Customer Attribute value programmatically?
I have tried below code but it didn't work.

protected $customer;

public function __construct(
    \Magento\Customer\Model\Customer $customer
)
{
    $this->customer = $customer;
}

...
...

$customerId = "1";
$customer = $this->customer->load($customerId);
$data = "customer attribute value";
$customerData = $customer->getDataModel();
$customerData->setCustomAttribute('customer_attribute_code',$data);
$customer->updateData($customerData);
$customer->save();

Is there any other method to save the customer attribute?


texts: Echo product attributes elsewhere on product page in Magento 2?

texts:
Currently working on a Magento 2 build, and I've been stumped by something I guess is probably pretty simple.

As it stands, product pages are pretty much default, and product attributes are shown in the 'More Information' tab at the bottom.

What I'm attempting to do is echo an attribute's value elsewhere on the product page.

Since by default it seems to pass all the values to the page, I'm guessing there's simply a piece of syntax I'm missing for calling it in one of the product page view files.

I've tried a few things, such as:

$_product->getAttributeText('discount_banner');

But they seem to be the syntax for Magento pre-2.0.

If anyone can help out with what I'm doing wrong, I'd be incredibly appreciative.


texts: Is it safe to truncate the catalog_category_product_index table?

texts:
That is, will it be re-indexed from scratch?

I can not find it in the list of tables that are safe to truncate here.

I'm on Magento 1.4.1, although this should apply to other versions as well, provided the index does still exist.


texts: Merge changes from remote magento repos get aborting

texts:
Today went to to get new changes from the Magento repo in the develop branch.
I'm using phpstorm.

Commands I used

git remote add mageblob git@github.com:magento/magento2.git
git fetch mageblob
git checkout dev <= this is my local dev
git merge mageblob/develop

Merge process go aborting and suggest me remove files in dev/tests var/.htaccess v.v..
How to fix it.
p/s: Btw this is best way to pull all code changes from repos? i'm newbie in git


texts: Magento 2: good practice regarding custom module README.md

texts:
As you may have noticed, every Magento 2 core module contains a README.md file.

Example for the Magento_Catalog module:

  Magento_Catalog module functionality is represented by the following
  sub-systems:
   - Products Management. It includes CRUD operation of product, product media, product attributes, etc...
   - Category Management. It includes CRUD operation of category, category attributes

  Catalog module provides mechanism for creating new product type in the
  system. Catalog module provides API filtering that allows to limit
  product selection with advanced filters.

In order to follow good practices, I want to add a README.md to my custom module folder.

However, I'm not sure what should I write there ?

only a small description of the module
documentation
release notes
support links ?

What is or what could be the good practice regarding 3rd party modules README.md ?


texts:
I don't know why but i get this error: Call to a member function setData() on boolean in observer line 22, and this line is: $head->setData('title', $metaTitle);

Observer.php

class Namespace_Category_Model_Observer
{
    public function setMetaTitle(Varien_Event_Observer $observer)
    {
        $head = $observer->getLayout()->getBlock('head');
        $metaTitle = Mage::registry('current_category')->getMeta_title();
        Mage::log($metaTitle); //I get the right value
        if (Mage::registry('current_category')) {
            $head->setData('title', $metaTitle); //line 22
        }
    }
}

The event that i used is: <controller_action_layout_load_before>

EDIT: I just realized that i can't return a head block, $head return nothing !

I tryed also Mage::app()->getLayout()->getBlock('head') but it doesn't work


texts: Magento 2 dropdown navigation sub level unreachable

texts:
The Problem
When building a new theme using the Blank magento 2 theme as the parent, our dropdown navigation is not working as intended. Below is a picture of the current result. As you can see we went down 3 levels with no problem, as they were all the top item of each level. However when we go down to the bottom one which is highlighted in red, the next step in the dropdown menu appears at the top.
What I know so far
When inspecting these elements, one piece of code stands out, which if I remove, it causes a separate issue where the menu shows up next to the item, BUT 53 pixels too low, also making it impossible to reach.
The code I am referring to is located in lib/web/css/source/lib/_navigation.less and is
.submenu {
   top: 0 !important;
   left: 100% !important;
}

I know that there is a JS component to this menu, but im not sure what to do about it. I have tried messing with the inspector as much as I could to get it to work with just CSS, but it seems to be dynamically generated.


texts: Shipping fee categories base and set max shipping fee

texts:
Is it possible to set shipping fee base on product categories and apply max shipping fee.

Ex: I have 10 categories of product (Category 1, 2, 3, ... 10).

Conditions

If customer buy from Categories 1:

1 pcs shipping fee is 100
2 pcs shipping fee is 200
more than 2 pcs shipping fix at 200

If customer buy from Categories 2-10:

1 pcs shipping fee is 70
2 pcs shipping fee is 140
more than 2 pcs shipping fee is 200

3. If customer buy mix from Categories 1-10:

1 pcs from Categories 1 is 100
1 pcs from Categories 2-10 is 70

Max shipping fee is 200, mean buy any pcs shipping fee = 200

Is this possible to set with default Magento promotion ?

Right now I custom code, but it effect to system when I set free shipping. so I want to convert back and using default Magento rule.

Or any extension support this kind of task ?

Thanks


texts: Category ids, where are they defined in the admin?

texts: I'm having some trouble finding the category id of the categories I'm examining.  Where are they defined in the admin?


texts: Magento2 - Checkout session returning empty if cache is enabled issue

texts:
I am setting the custom checkout session value in controller and I am not getting that value in view model.
If cache is disable I am getting the get the session value but If cache is enabled If returning empty value.
Is anyone having any idea on this?


texts:
I'm on developing a new theme.
I replaced the cart and the Wishlist Links with icons.

Now I wanted to do the same with My Account. But I'm not able to find the template file. I found this Question: where is default template for link defined?

But the solution is a joke, isn't it?!
Do I have to do some wired pointless classes and blocks, just to put in an icon?!

C'mon just tells me where the template file is. It can't be so difficult.
Thanks.

Edit:
Can I do something like:

<move element="my-account-link" as="<img src='PATH_TO_ICON'>" />

And how would be the Path to the Icon (/app/design/frontend/<vendor>/<theme>/web/images/icons/example.png)?


texts:
I have a website running on magento i m facing some issues on my site can any person help me in rectifying the issues......

When i m trying to get print of invoice from admin panel in magento m getting error .

**Trace:
0 /home/content/30/11052930/html/includes/src/Zend_Pdf_Resource_ImageFactory.php(54): Zend_Pdf_Resource_Image_Png->__construct('/home/content/3...')
1 /home/content/30/11052930/html/includes/src/Zend_Pdf_Image.php(124): Zend_Pdf_Resource_ImageFactory::factory('/home/content/3...')
2 /home/content/30/11052930/html/includes/src/Mage_Sales_Model_Order_Pdf_Abstract.php(158): Zend_Pdf_Image::imageWithPath('/home/content/3...')
3 /home/content/30/11052930/html/includes/src/Mage_Sales_Model_Order_Pdf_Invoice.php(123): Mage_Sales_Model_Order_Pdf_Abstract->insertLogo(Object(Zend_Pdf_Page), Object(Mage_Core_Model_Store))
4 /home/content/30/11052930/html/includes/src/Mage_Adminhtml_Controller_Sales_Invoice.php(119): Mage_Sales_Model_Order_Pdf_Invoice->getPdf(Array)
5 /home/content/30/11052930/html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php(489): Mage_Adminhtml_Controller_Sales_Invoice->printAction()
6 /home/content/30/11052930/html/includes/src/__default.php(13589): Mage_Adminhtml_Sales_Order_InvoiceController->printAction()
7 /home/content/30/11052930/html/includes/src/__default.php(17934): Mage_Core_Controller_Varien_Action->dispatch('print')
8 /home/content/30/11052930/html/includes/src/__default.php(17491): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
9 /home/content/30/11052930/html/includes/src/__default.php(20068): Mage_Core_Controller_Varien_Front->dispatch()
10 /home/content/30/11052930/html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
11 /home/content/30/11052930/html/index.php(87): Mage::run('', 'store')
12 {main}

Error log record number: 1632019843**

Can any 1 tell how to rectify this error.

How can i change the format of invoice. changing the logo and text to be displayed on invoice.

Please help me i in big trouble. I'm having loss on daily basis because of these small issue in my website.

1. Message which is showing is "Only non-interlaced images are currently supported".
2. Logo already exists.

In admin panel when i click on invoices and open previous invoice. Then click on print it shows this error. But send email feature is working fine it is sending email to mail id mentioned.
Can you please also guide me how to change the format of invoice.


texts: How to inject code before  by extension in all Magento pages

texts:
I need to build custom extension (code pool 'community') that should add some Javascript just before the HTML body tag is closed.

So far after some research it seems that the most elegant way to do this is to use 'before_body_end' reference. I found this article and recreated all steps exactly as described (except I'm using the 'community' code pool) on a fresh clean default Magento CE 1.9.2.1 installation. But nothing happens. The extension is enabled in 'Configuration/Advanced', cache is cleaned, no errors at all... The custom phtml isn't loaded.

Can anyone describe (or refer to) what steps should be done to make it work?

Maybe there is another way (not with 'before_body_end') to make it work?


texts: Configurable products: product image not updating after selecting attribute in dropdown

texts:
I have a configurable product that has three variations (flavours).

The configurable product has 3 different images, I labelled them vanilla, chocolate, and strawberry (same as the attribute values)

I was expecting the product image to update on the frontend when you select one of the flavours.

Isn't that what's supposed to happen?


texts: Can't get past Step 1 at checkout (only random customers)

texts:
So we have been getting a few complaints each day from customers who cannot complete checkout. The clients with issues cannot get past Step 1 of the checkout. They say they click the Continue button but either the loading animation doesn't stop, or it does stop but doesn't move to the next step. Different browsers or computers does not make a difference, it seems to be happening on certain internet connections.

I had OneStepCheckout enabled when we first started getting complaints, and I switched to Magento's One Page Checkout hoping that that would fix it. It did not. So with OneStepCheckout, their order would not go through (they filled out all their info and then clicked the Place Order button). With Magento's default checkout, they cannot get past the first step. So it seems like something is not allowing the buttons to be clicked, or the information is not sending after the button is clicked. There is no error message, they just can't continue the checkout.

It seems to be only international customers (99% Brazil but I think there was a complaint from Sweden too), but maybe USA customers just aren't emailing us about it.

I cannot replicate this issue. If I log in with these customers accounts, I can complete the checkout just fine.

If these customers use a different internet connection (at a friend's house or on a 3g phone for example) that usually fixes their problem.

This has been happening since early/mid June :(


texts: How to get product images of a specific category in magento2?


texts: Magento 2.1.5 add product attribute programmatically does not work

texts:
I want to create attribute programmatically. I've tested few codes but all of them doesn't work for me.

Here are my steps:

Create InstallData.php file with code like this one below.

IN InstallData.php my PhpStorm highlights "undefined class
EavSetupFactory"

I use command in magento root folder "php bin/magento setup:upgrade". -

IN InstallData.php my PhpStorm highlights "undefined class EavSetupFactory"
After that i see "Please re-run Magento compile command"
I checked admin panel there is no new attributes

Next step i use "php bin/magento setup:di:compile".

IN - InstallData.php now its ok, no comunicate with "undefined class
EavSetupFactory" i can redirect to this class
Check admin panel, still no attributes

Again use "php bin/magento setup:upgrade".

IN - InstallData.php my PhpStorm highlights "undefined class EavSetupFactory"
Still no new attributes in admin panel

I repeated my steps with different examples of code in InstallData.php. As I mentioned above this is just one of many I've used, they are quite similar (but still there are some small differences) and file look like this:

namespace LCB\Import\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory; //here is mentioned highlight
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{

private $eavSetupFactory;

public function __construct(EavSetupFactory $eavSetupFactory)
{
    $this->eavSetupFactory = $eavSetupFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'test_attribute',
        [
            'type' => 'int',
            'backend' => '',
            'frontend' => '',
            'label' => 'Test Attribute',
            'input' => '',
            'class' => '',
            'source' => '',
            'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => 0,
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]
    );
}
}


texts: Magento2.3 - How to connect Multi-Store to Multi-Source Inventory?

texts:
We would like to implement a Multi-Store Implementation where one Store is connected to our Main Warehouse for Online orders while the second store runs our POS system and can only debit stock from our Physical Retail Location's stock.

Is this something that is possible in Magento where we can implement both Multi-Store as well as Multi-Source model so that I run one unified back end but have it debit from a different physical location depending on where the order comes from?


texts: How to override addtocart.phtml for all type of product in magento 2

texts:
I have done this but my code is not working for all types of product.

layout file

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock name="product.info.stock.sku" remove="true"/>

        <referenceBlock name="product.info.addtocart">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Vendor_Modulename::product/view/addtocart.phtml</argument>
            </action>
        </referenceBlock>

</page>

Template

<?php

?>
<?php $_product = $block->getProduct(); ?>
<?php $buttonTitle = __('Add to Cart'); ?>
<?php if ($_product->isSaleable()): ?>

        <?php if ($block->shouldRenderQuantity()): ?>

            <?php /* @escapeNotVerified */ echo __('Qty') ?>

                <input type="number"
                       name="qty"
                       id="qty"
                       maxlength="12"
                       value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
                       title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty"
                       data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
                       />

            <input
                type="text"
                name="remarks"
                id="remarks"
                maxlength="255"
                placeholder="Please enter your name"
            />

        <?php endif; ?>

            <button type="submit"
                    title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>"
                    class="action primary tocart"
                    id="product-addtocart-button">
                <?php /* @escapeNotVerified */ echo $buttonTitle ?>
            </button>
            <?php echo $block->getChildHtml('', true) ?>

<?php endif; ?>

<?php if (!$block->isRedirectToCartEnabled()) : ?>

<?php endif; ?>


texts: Move block to a different reference block

texts:
I need to move a subscription block from MageMonkey module.

Here is the magemonkey.xml file and block that I want to move:

<checkout_onepage_review>
    <reference name="checkout.onepage.review.info.items.after">
        <block type="monkey/checkout_subscribe" name="magemonkey.subscribe"
               template="magemonkey/checkout/subscribe.phtml">
            <block type="monkey/signup" name="left.monkeysignup" template="magemonkey/lists.phtml"/>
        </block>
    </reference>
</checkout_onepage_review>

Here is my checkout.xml file with the review block:

<checkout_onepage_review translate="label">
    One Page Checkout Overview

    <remove name="right"/>
    <remove name="left"/>

    <block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">
        <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
        <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>
        <block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
        <block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label">
            Items Before
        </block>
        <block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label">
            Items After
        </block>
          <block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml" />
        <block type="core/template" name="checkout.onepage.review.button" as="button" template="checkout/onepage/review/button.phtml"/>
    </block>
</checkout_onepage_review>

I want to move the magemonkey.subscribe to go below the checkout.onepage.agreements. I tried that but didn't work:

  <checkout_onepage_review>
      <reference name="checkout.onepage.agreements">
          <block type="monkey/checkout_subscribe" name="magemonkey.subscribe"
                 template="magemonkey/checkout/subscribe.phtml" output="toHtml">
              <block type="monkey/signup" name="left.monkeysignup" template="magemonkey/lists.phtml"/>
          </block>
      </reference>
  </checkout_onepage_review>

I can move it to the checkout.onepage.review.info.items.before and it work fine so I am guessing this has something to do with the type of the block I am trying to move it to. I added output="toHtml" but that didn't work either. Any one knows what I am doing wrong?

I also tried:

  <checkout_onepage_review>
      <reference name="root">
          <block type="monkey/checkout_subscribe" name="magemonkey.subscribe"
                 template="magemonkey/checkout/subscribe.phtml" output="toHtml" before="checkout.onepage.review.button">
              <block type="monkey/signup" name="left.monkeysignup" template="magemonkey/lists.phtml" />
          </block>
      </reference>
  </checkout_onepage_review>

But still no luck.

Am I even looking in the right place? This is driving me insane now...


texts: Stock is not updating after update the product quantity Magento 2.x?

texts:
I am facing an error in Magento 2.1.5. I have changed the product quantity from Magento admin panel but the stock did not update.

I have clean cache already but it still showing out of stock.

Can anyone please help me to solve it.


texts: How to create custom SOAP api for magento 2.0?

texts: How to create custom SOAP api in magento 2.0? Please share you link if you have already work on it.


texts:
I have found mass Invoice in the following link,

How to create invoices for more than one order via mass action?

Similarly, how to create shipment for more than one order via mass action drop down ?


texts: Error on SSH command line installing Magento 2 extensions

texts:
I have this error that makes me impossible to continue using SSH. I am installing MAGENTO 2.3.2 extensions

  Fatal error: Class Magento\Setup\Mvc\Bootstrap\InitParamListener
  contains 1 abstract method and must therefore be declared abstract or
  implement the remaining methods
  (Zend\ServiceManager\Factory\FactoryInterface::__invoke) in
  /home/vaporartuk/public_html/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php
  on line 33

Does someone know how to correct it?


texts: Magento 1.9 - Customer placed the order successfully but its not in the Magento Admin Panel

texts:
I am facing a very serious issue with Magento 1.9 website. This has happened a couple of times. Customer places the order, they even get an email confirming the order but the order does not show in the Magento admin panel.

Could you please help shade some light as to what could have caused this?

Thanks


texts: Fetch product category name in order summary at checkout page

texts: Hi I am looking to fetch the product category name in the order summary of checkout page. Which file do I need to edit to fetch the data


texts: magento 2 default messages not showing on product detail page only

texts: Success and other messages not coming on product detail page only, While if we moving to another page it is visible, Anyone have suggestion then please share.


texts:
I did create custom.css in app/design/frontend/hsc/hsc-theme/web/css. But it didn't work how to do it?
How to override default css in new theme in magento 2.1?


texts: Magento 2 - 11k Products on 1 configurable product too much?

texts:
A few specs:
Using magento 2.1
PHP 7.0.9
VPS has 48GB RAM
8x Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz

I am setting up an online print shop, and have created a CSV of all of our 100k+ variations we offer. Our latest variation range is the leaflets, offering these on 6 different papers, 13+ sizes, 5+ lamination methods, 4+ delivery speeds, 20+ quantities. Some delivery speeds are not available on certain quantities etc, ad we end up with about 11k associated products on this 1 configurable product. Last night it all loaded fine, tried a bunch of the options, prices updated correctly etc. However this morning I tried it, and the page wouldnt even load. Upon logging into WHM and checking the CPU usage, alot of CPU was being used on 1 process.

11250 (Trace) (Kill)    str 0     65.33 0.38    /opt/cpanel/ea-php70/root/usr/bin/php-cgi

Anyone know a way of trying to find out what could be causing it? Is it the fact Magento cant handle 11k associated products?


texts: Magento2 : Recommended way to properly filter the logs?

texts:
Recommended way to properly filter the logs?

It's like a log4j Java app with every logger active, so essentially a flood of useless chatter.  Is there any way I can configure or manage what gets logged?  Mabye set a level threshold?  Or even disable certain loggers?


texts: How can disable the cache for some block in Magento 2

texts:
Please check Below code.
I have try to get customer country code on footer.phtml. I have used GeoIP plugin to get. And added this code to block. Anyone let me know that How can I get this code out of a cache.

Issue: currently all visitor get the same county due to load this block from the cache.

namespace Rokanthemes\Themeoption\Block;
    class Themeoption extends \Magento\Framework\View\Element\Template
    {
        public $geoIpService;

        public function __construct(
            \MagePal\GeoIp\Service\GeoIpService $geoIpService,
            array $data = []
        ) {
            $this->geoIpService = $geoIpService;
            parent::__construct($context, $data);

        }
        public function ipCountry()
        {
            return $this->geoIpService->getCountry();
        }
    }


texts: Magento 2: Percent coupon with discount amount limit

texts: I want to give customers a 10% discount coupon but I want to enforce a discount amount limit, that is that the maximum discount amount is $250. Is there a way to limit this using a coupon?


texts:
I need to hide related products from cart page.

I have created a module which converts selected related products name as custom options dynamically. When I add a product to cart after selecting its related products, I need to hide related products and show them just as product options for the main product.

I have added the code which creates custom options or "additional options" dynamically when a product is added to cart. I just need to hide the related products.

I don't want to hide the product throughout the site but just in cart. Is it possible to hide a product in cart dynamically?

Any help is appreciated.


texts:
I'm trying to update my custom module's database table.

An so far i have done this.

Created mysql4-upgrade-0.1.0-0.1.1 - With the following code

<?php
$installer = $this;
$connection = $installer->getConnection();
//do this for each column you want to add
$connection->addColumn($installer->getTable('emailorder'), 'number_of_entries', array(
        'type'      => Varien_Db_Ddl_Table::TYPE_INTEGER,
        'nullable' => false,
        'comment'   => 'Number Of Entries',
    ));

Ive change the vertionsnumber in the module config.xml
and in the etc/module folder

Still it doesn't update my database table. What to do?


texts: Cancel removal process of block in layout.xml

texts:
I want to undo the removal of a block.

the block is removed in vendor/magento/theme-frontend-blank/Magento_Checkout/layout/checkout_index_index.xml

<referenceBlock name="minicart" remove="true"/>
<referenceContainer name="header.panel" remove="true"/>
<referenceBlock name="top.search" remove="true"/>
<referenceBlock name="catalog.compare.link" remove="true"/>
<referenceBlock name="catalog.topnav" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>

According to the documentation, one can canel the removal with remove=false.

So I created a file in my theme in Magento_Checkout/layout/checkout_index_index.xml

<referenceBlock name="minicart" remove="false"/>
<referenceContainer name="header.panel" remove="false"/>
<referenceBlock name="top.search" remove="false"/>
<referenceBlock name="catalog.compare.link" remove="false"/>
<referenceBlock name="catalog.topnav" remove="false"/>
<referenceContainer name="footer-container" remove="false"/>

But this does not work. According to this github issue, it's not a bug

EDIT:

Here's also a related forum post


texts:
I want to programatically change the product form type of simple to virtual. Is there any way to achieve this? I found something similar here but it's not working it seems. I tried to log the result and it is indeed setting it to virtual but when I try to visit the checkout/#shipping  page the quote item becomes non virtual not sure why. But would appreciate if someone has done the same thing. Below is my code
I created my observer and this is the code of the observer
<?php
namespace Tcm\Checkout\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;

class UpdateProductType implements ObserverInterface
{
    public function __construct(\Psr\Log\LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $item = $observer->getEvent()->getData('quote_item');
        $product_options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
        $options = $product_options["options"];

        foreach ($options as $option) {
            if (!(isset($option['label']) && strtolower($option['label']) == "delivery method" && isset($option['value']) && strtolower($option['value']) == "e-card")) {
                continue;
            }

            $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
            $item->setProductType(\Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL);
            $item->getProduct()->setIsSuperMode(true);
            $item->getProduct()->setWeight(0);
            $item->getProduct()->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL);
            $item->save();
            $this->logger->error("Setting to virtual", [$item->getData()]);
        }
    }
}

Now logging here shows that the product is set to virtual but when visiting the checkout/#shipping page and logging the quote item inside the shipping.js it's returning that the item is not virtual. How can I make it virtual? Basically my aim is to set the item to virtual so that when reaching the checkout/#shipping page the shipping field will not be displayed anymore


texts: M2 - Best practice for adding custom less file in Custom Theme for CMS Static Block

texts:
I just created custom theme, i have followed a number of guides to properly setting up .less files in a custom theme and nothing seems to be working.
Where should i place less file for cms custom block,
_theme.less or _extend.less or _module.less or create Magento_cms->web->css
What is the best practice?


texts: Quote (item) is missing but the order exists

texts:
I experience a strange issue: The order was placed successfully but I can't find any according quote.

mysql> select increment_id, entity_id, quote_id, created_at  from sales_flat_order where increment_id=100000432;
+--------------+-----------+----------+---------------------+
| increment_id | entity_id | quote_id | created_at          |
+--------------+-----------+----------+---------------------+
| 100000432    |      1029 |    10383 | 2015-10-28 23:12:13 |
+--------------+-----------+----------+---------------------+
1 row in set (0.00 sec)

mysql> select * from sales_flat_quote where entity_id=10383;
Empty set (0.00 sec)

mysql> select * from sales_flat_quote_item where quote_id=10383;
Empty set (0.00 sec)

Isn't there always a quote?

Any chance to create a quote on base of the order?

The issue I'm facing right now is that I can't pull any order information in backend because an extension is throwing an exception because of the missing quoteItemId.

Any help is much appreciated. Thanks.


texts: I can't login to the frontend of my webshop

texts:
First i want to say that i'm pretty new to Magento.

Setting up a shop is going pretty well as I can say for myself.

Now when i make myself a member, i get a nice email with some information and a verification link. When i click this link i'm logged in to my site. When i log out and try to login again nothing happens. No errors and i stay on the login page. I read something about cookies but as i told already im pretty new to Magento.

I work with directadmin and Magento 1.9.0.1. Can someone please tell me step by step how i can fix this.

Already thanks for your help.


texts: multi-language feature not working automatically

texts:
I have a question. If any body help me on this. that would be good for me.
I have multiple store view (Like: English, French, Spanish etc). I created those store view with currencies in backend and also install language package for each stores. Website default words is translated properly using CSV. But I want to translate the all data Like CMS Page, Products, Categories information without input data in admin in each store view. I have 1M Products and 70 CMS page. It's hard to add other language data for every stores.

Thanks
Vishal


texts: Magento 2.2.7 error when using bulk attribute update when item is enabled

texts:
When trying to use the bulk update attributes I get the following error:

  Exception message: Required parameter 'theme_dir' was not passed

I've been chasing this error for the last 2 weeks.  At one point the function worked fine but now it doesn't.

I finally found out when you disable the item you can use the bulk attribute update and it works fine.

Any ideas what might be causing this?

Rich


texts: I am using transport builder to send mail in custom module.The emails are going successfully to all emails as per WHM, but unable to receive to any other domain. Able to receive the emails to own domain.


texts: Product prices should visible after entering username and password as like admin panel

texts:
If we visit magento site, Products "prices" or "add to cart button"[optional either one] should not visible on entire site[on product list page, product view page, featured products , everywhere.] after entering username and password only customers can see the products prices.  [as like in admin panel login, but USername: & password box: should be on home page] ,

Please help me to find solution.


texts: How add sku attribute to TotalsItemInterface?

texts:
I want to add sku attribute to Magento\Quote\Api\Data\TotalsItemInterface (and Magento\Quote\Model\Cart\Totals). This attribute is not my and default for magento, but he turned off from the interface. If I directly add code to this file I have sku attribute in "Order Summary" block in checkout step 1.

But I want use extension_attributes.xml for except touching core files.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Quote\Api\Data\TotalsItemInterface">
        <attribute code="sku" type="string" />
    </extension_attributes>
</config>

It not working. Next I try execute setup:di:compile. No working.

What I need to do?


texts: Product name is displayed on website as all caps, but was not entered in Admin as all caps

texts:
In the Admin Panel when I enter the following as the product name:

  Lighthouse Clear SF Stamp Mounts 160mm x 120mm  d (10 strips)

When I view the product on the website it displays as below (In uppercase):

  LIGHTHOUSE CLEAR SF STAMP MOUNTS 160MM X 120MM D (10 STRIPS)

I do not want it to make the change.  I want it just the way I typed it in Admin.

How can I stop this from happening?


texts: Can I allow specific URL of default Magento2 Frontend and restrict all other Frontend URLs?

texts:
Our Magento frontend is in vue storefront, so we have restricted default Magento frontend URLs for our system. But I need one URL of frontend which is

http://127.0.0.1/index.php/customer/account/createpassword/

I allowed it using observer:

<event name="controller_action_predispatch">`

and allowed frontname as:

if($routname!="customer" ) {

    $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
    $this->redirect->redirect($controller->getResponse(),$this->HelperBackend->getHomePageUrl());

}

But the problem is after a user set his password he is redirected to this URL:

http://127.0.0.1/index.php/customer/account/login/

I don't want the user to see this URL. Instead, he should be redirected to vue storefront URL or backend URL or any customer url. How can I do this? Thanks

Update:

I tried doing like this

if ($routname!="customer") {
    if ($controllerName!="account") {
        if ($actionName!="createPassword") {
        $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
        $this->redirect->redirect($controller->getResponse(),$this->HelperBackend->getHomePageUrl());
    }
    }
}

Still I can access all the actions under frontname "customer". I want only "createPassword" action!


texts: How can I execute sales_order_place_after observer for multiple times for testing purpose

texts: I want to do some manipulations after placing order want to check for each change in different scenarios to check changes each time I need to place order, is there any other way so that I can execute observer for many times with one order.