texts: Why does Magento 2 use RequireJS `map` instead of `path`

texts:
In Magento 2's RequireJS implementation, many core modules use a configuration something like this

map: {
    '*': {
        editTrigger:   'mage/edit-trigger',
        addClass:      'Magento_Translation/add-class'
    }
}

In RequireJS, the map configuration directive allows developers to tell RequireJS

  When you load module X, and it uses module Y, replace module Y with module Z -- but only for Module X

Or, in code

map: {
    'modulex':{
        'moduley':'modulez'
    }
}

The map feature basically allows you to swap out module definitions via configuration -- in Magento speak, it's a module rewrite feature for javascript.

What's not clear to me though is Magento's heavy use of the * as the key for the map property.

map: {
    '*': {
        editTrigger:   'mage/edit-trigger',
        addClass:      'Magento_Translation/add-class'
    }
}

The * basically says *do this mapping for all modules, and its intended use case is is provide a base module aliasing that can be changed for more specific modules.

However, Magento appears to use it as a replacement for RequireJS's paths property.  i.e. it seems Magento could have achieved the same thing with the following

paths: {
    'editTrigger': 'mage/edit-trigger',
    'addClass':    'Magento_Translation/add-class',
}

and then selectively does specific mapping when needed.

Does anyone know why Magento chose map:* as its method for path aliasing?  i.e -- is my understanding of the difference between map and path incomplete -- or is this one of those "Six of one, half dozen the other" things.  Or is there some additional behavior Magento gets by doing it this way.

Not asking to solve a specific problem, asking to clarify any misunderstandings of RequireJS and Magento's implementation before I start writing heavily about it :)


texts: Add to cart not working after login in magento

texts:
In magento add to cart not working after login but without login its works fine. Here is my website url

Please look into this


texts: Group simple product with fixed price, without qty and user selection option

texts:
Is it possible to combined together simple product with fixed price, without qty and user selection option, Custom Option??

Wanted to have feature like grouped product but without user interaction to select product, it should be sold as together with one single price.


texts: After changing magento deploy mode to developer site stop working. Magento 2.2.3

texts:
Fresh installed Magento 2.2.3 with sample data everything worked fine. until I changed the deploy: mode to the developer mode. Now it is showing a blank page, there is no error only blank screen.

Refreshed the cache
Deleted all cache folders
Generated folder and cleared pub/static folder too (leaving .htaccess) file.
Recompiled the code
Run setup upgrade

commands but without any solution.

please help.


texts:
Hoes does the cart items get inside minicart? More precisely inside minicart.js there is a variable cart that has a field items that contains the same products as the cart. How does that cart variable gets populated?

I ask this because i have another table that contains reserved products and i'd like to know how can i have inside minicart.js a variable of my own that has items from my custom table.


texts: How to Redirect to Product View Page if No option Options are Selected In magento 2

texts:
i am making a guestwishlist i want to know how i can make a condtion if no product options are selected if must have to redirect me to product view page on add to cart option magento..

i did this so far

if (!$this->customerSession->isLoggedIn()) {
            $cookieValue = explode(', ', $this->cookieManager->getCookie(self::COOKIE_NAME));
            $cookieValue=array_filter($cookieValue);
            foreach ($cookieValue as $productId) {
                $product = $this->product->load($productId);
                try {
                    $params = array(
                        'form_key' => $this->formKey->getFormKey(),
                        'product' => $productId,
                        'qty'   =>1
                    );
                    $this->cart->addProduct($product, $params);
                    $this->cart->save();

                } catch (\Throwable $ex) {
                    $this->messageManager->addError(__($ex->getMessage()).' for '.$product->getName());
                }

            }
        }
        return $this->resultRedirectFactory->create()->setPath($this->_redirect->getRefererUrl());


texts: Replace Product Image Upload in backoffice with Media Gallery

texts:
I would like to ask you if you know an extension to change the image upload behavior in product edit page in backoffice.
The goal would be:

Edit a product in the backoffice
Go to Images and Videos
When clicking on "Browse to find or drag...", instead of opening the image upload file dialog, open the Magento Media Gallery so that we can select existing images or upload new ones.

Thanks for your help!


texts:
I try to create programmatically an integration in Magento 2.

I follow this tutorial :

https://magecomp.com/blog/create-activate-authorize-a-new-integration-programmatically-in-magento-2/

I have something like that :

// Create Integration
$integrationFactory = $this->integrationFactory->create();
$integration = $integrationFactory->setData($integrationData);
$integration->save();
$integrationId = $integration->getId();
$consumerName = 'Integration' . $integrationId;

// Create consumer
$consumer = $this->oauthService->createConsumer(['name' => $consumerName]);
$consumerId = $consumer->getId();
$integration->setConsumerId($consumer->getId());
$integration->save();

// Add grant permission
$this->authorizationService->grantAllPermissions($integrationId);

// Activate and Authorize
$token = $this->tokenFactory->create();
$token->createVerifierToken($consumerId);
$token->setType('access');
$token->save();

It's work but all 'save' function are deprecated. I don't succeed to find another way to save integration, consumer and token.

Do anyone have any idea?


texts: How to send confirmation email at the time of customer creation programatically?

texts:
How to send confirmation email at the time of customer creation programatically ?

Customer created,but I cannot send confirmation email? Any help?

 public function createCustomerSocial($data, $store)
{
    /** @var CustomerInterface $customer */
    $customer = $this->customerDataFactory->create();
    $customer->setFirstname($data['firstname'])
        ->setLastname($data['lastname'])
        ->setEmail($data['email'])
        ->setStoreId($store->getId())
        ->setWebsiteId($store->getWebsiteId())
        ->setCreatedIn($store->getName());

    try {
        // If customer exists existing hash will be used by Repository
        $customer = $this->customerRepository->save($customer);

        $objectManager     = \Magento\Framework\App\ObjectManager::getInstance();
        $mathRandom        = $objectManager->get('Magento\Framework\Math\Random');
        $newPasswordToken  = $mathRandom->getUniqueHash();
        $accountManagement = $objectManager->get('Magento\Customer\Api\AccountManagementInterface');
        $accountManagement->changeResetPasswordLinkToken($customer, $newPasswordToken);
        $subscriber= $objectManager->create('Magento\Newsletter\Model\SubscriberFactory');
        $subscriber->create()->subscribe($data['email']);

//            if ($this->apiHelper->canSendPassword($store)) {
                $this->getEmailNotification()
                    ->newAccount($customer, EmailNotificationInterface::NEW_ACCOUNT_EMAIL_CONFIRMATION);
            $this->getEmailNotification()
                ->newAccount($customer, EmailNotificationInterface::NEW_ACCOUNT_EMAIL_REGISTERED);
//            }

            $this->setAuthorCustomer($data['identifier'], $customer->getId(), $data['type']);
        } catch (AlreadyExistsException $e) {
            throw new InputMismatchException(
                __('A customer with the same email already exists in an associated website.')
            );
        } catch (\Exception $e) {
            if ($customer->getId()) {
                $this->_registry->register('isSecureArea', true, true);
                $this->customerRepository->deleteById($customer->getId());
            }
            throw $e;
        }

        /** @var Customer $customer */
        $customer = $this->customerFactory->create()->load($customer->getId());

        return $customer;
    }


texts: Layered navigation state not updating, state block not rendered

texts:
When I click on a filter, page reloads and filters products correctly, but new state does not appear on sidebar menu. For some reason state block is not rendered.

I tried with default theme and it works, so it should be theme specific. Weird is that this anomaly does not happen on localhost. Even more weird is that when I turn on template hints with Magento debug module, it refreshes something and state block suddenly gets rendered. This however does not happen when I manually activate template hints.

So activating filters and removing them works but state block does not update. Only thing that makes state block render updated information is toggling template hints from Debug Module. What could cause that?

I just in case mention, that I also tried to deleting both, state.phtml and view.phtml in my custom theme catalog/layer, but this did not change anything.

What could it be?


texts: URL paths are missing a slash to access resources

texts:
I just installed Magento on localhost,  the installation succeed, however when I open the store non of the media, CSS and JS loads due to magento generating an incorrect URL,
here is an example:

http://localhostskin/frontend/enterprise/default/css/widgets.css

Note how it concatenated localhost with the "skin" folder, this is due to a missing forward slash, however I've been unable to fix the issue, both my secure and web unsecured urls on the core_config_data  (web/secure/base_url and web/unsecure/base_url )are set to :

http://localhost/

I installed magento on top of the zend framework, also my local.xml seems to be fine:

<host><![CDATA[localhost/]]></host>

I've been struggling on this but I cant fix it, has anyone encounter with these type of issues?

Note that I'm unable to login to the admin console (due to the JS files not loading)


texts:
I am getting error Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_daily.period' in 'field list' when I am trying to export the bestsellers report.

a:5:{i:0;s:114:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_daily.period' in 'field list'";i:1;s:2597:"#0 /lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT COUNT(*)...', Array)
#3 /lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query('SELECT COUNT(*)...', Array)
#4 /lib/Zend/Db/Adapter/Abstract.php(825): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#5 /lib/Varien/Data/Collection/Db.php(217): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array)
#6 /lib/Varien/Data/Collection.php(225): Varien_Data_Collection_Db->getSize()
#7 /lib/Varien/Data/Collection.php(211): Varien_Data_Collection->getLastPageNumber()
#8 /lib/Varien/Data/Collection/Db.php(581): Varien_Data_Collection->getCurPage()
#9 /lib/Varien/Data/Collection/Db.php(623): Varien_Data_Collection_Db->_renderLimit()
#10 /app/code/core/Mage/Sales/Model/Mysql4/Report/Collection/Abstract.php(247): Varien_Data_Collection_Db->load(false, false)
#11 /app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(923): Mage_Sales_Model_Mysql4_Report_Collection_Abstract->load()
#12 /app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(980): Mage_Adminhtml_Block_Widget_Grid->_exportIterateCollection('_exportCsvItem', Array)
#13 /app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php(128): Mage_Adminhtml_Block_Widget_Grid->getCsvFile()
#14 /app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_Report_SalesController->exportBestsellersCsvAction()
#15 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(257): Mage_Core_Controller_Varien_Action->dispatch('exportBestselle...')
#16 /app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#18 /app/Mage.php(627): Mage_Core_Model_App->run(Array)
#19 /index.php(101): Mage::run('', 'store')
#20 {main}";s:3:"url";s:184:"/index.php/admin/report_sales/exportBestsellersCsv/key/ca21fc853d7ad9e701576e13db4a6e37/filter/ZnJvbT0yJTJGMTclMkYxMiZ0bz0yJTJGMTclMkYxNiZwZXJpb2RfdHlwZT1kYXkmc2hvd19lbXB0eV9yb3dzPTA=/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

Please let me know if anyone has any idea how this can be fixed.
Any help would be appreciated.


texts: How to delete all stored Credit card #'s except the ones from within the last month?

texts:
Magento 1.9.1
Porto theme

We have credit card numbers stored. We need to delete them (for security reasons) but we would prefer to keep the numbers from within the last month just in case there be any charge backs etc.

What is the best way to do that?


texts: Magento 2: How to change the content of print order

texts: I need to change the content of printed form of the order. (My Account-> My Orders -> View Order ->Print Order). Which file is to be edited for the changes?


texts: The requested Payment Method is not available. Force Set Method

texts:
I have purchase order set as the only active payment method. Checkout throws the "requested method not available" error. I want to force set the payment method when it doesn't have a method set.

I'd like to do this in the theme, not the core.


texts: how to add new Block on login page magento2?

texts: I want to insert new block on login page in magento 2. Can anyone help me how can I add new block on login page?


texts:
I want (need) to implement a stadium ticket selling.
The idea is to let the customer choose his number of tickets (a capping on that might be needed but this is no big issue. I think I can achieve this through max qty allowed in cart). After that the customer must choose his seats from a seat map. After that the checkout process should go as usual.
Does anybody know an extension for this? I searched for one but I didn't find one to fit my needs. Or maybe my google skills need improvement.
If there is no extension, some pointers on how to do it would be great.
My idea so far is to create a product called 'Ticket' with some custom options (sector, row, seat number and maybe others).
The view page will be custom made, so the custom options will not be shown. The ticket selection will happen in a popup or overlay, and based on the selection I will simulate the custom options when adding to the cart.
The seat map will be kept in a table so I can mark the booked seats. The stadium is always the same so one map should be enough.
That's about it so far. Something seams to be missing. Any pointers would be great.
[EDIT]
There is a possibility to create a configurable product with 3 attributes (sector, row and seat number, each combination in qty available of 1 so they will not be available once they are bought), but this would mean 30k+ products (per event). I reeeealy don't want to go there. I'm keeping this as a last desperate resort.. (This is no longer an option because will result in a huuuuge performance issue)


texts: How to override the default email template from code?

texts:
According to https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/templates/template-email.html#customize-email-theme
default email template can be replaced, and it will be reflected automatically according to Template fallback. However, I don't know exactly where should I replace customized HTML and how to make sure it's reflected


texts: How to call a controller function in a block?

texts: Is it possible to call a controller function in a block, if yes, please define how can i achieve that.


texts: How to add static block to home page not wrapped in classes?

texts:
I am trying to add http://kenwheeler.github.io/slick/ to my Magento 2 home page. I was going to add the code in the header and the slides in a static block.

I have created a static block with the slides in there. My problem is it does not go full width because there is a div surrounding it with class="widget block block-static-block".

How can I remove those classes from the static block?

Or is there an easier way to do this that I am not thinking of? I am using 2.2.3 commerce.


texts:
How to get the product by price range through object manager in phtml file.
Like following

Get product where price is greater than 1 and less than 25


texts: Magento Home Page Featured Products - there are no products matching the selection


texts: Check if category has a parent in category view

texts:
I have an if statement that checks for specific category ID's and displays HTML if the condition is true. I have many categories and would like to only apply the HTML to categories that do have a parent.

Is there a way to check if the category has a parent?

The current code is rather heavy, and requires manual intervention when a new child category is added - there must be an easier way.

<?php if(in_array($_category->getId(), array(117,179,121,123))): ?>

Display this text.

<?php else: ?>

Display this text instead.

<?php endif; ?>


texts: Magento keeps changing an attribute's backend type from "int" to "varchar"

texts:
In Magento, you can't create a custom attribute of type "decimal" or "price".

But it's possible to create the attribute as text, and change the backend_type in it's database record from "varchar" to "decimal" or "int".  (table: eav_attribute)

But, Magento keeps changing it back to "varchar!!" Why?


texts: Add class to input element if field is required

texts:
In UIs ko template for an input field...

theme\Magento_Ui\web\templates\form\element\input.html

I would like it to have the class "required" depending on if the field's input actually IS required.

By default the template looks like this:

<input class="input-text" type="text" data-bind="
value: value,
valueUpdate: 'keyup',
hasFocus: focused,
attr: {
    name: inputName,
    placeholder: placeholder,
    'aria-describedby': getDescriptionId(),
    'aria-required': required,
    'aria-invalid': error() ? true : 'false',
    id: uid,
    disabled: disabled
}" />

Is there any way to know whether the currently rendered field is required or not?

Bonus question: how would I find out what kind of data is available to this template and how do I access it?


texts: How to get current store ID for Magento 2.3.2?

texts: How to get current store ID for Magento 2.3.2 version, I set up multiple stores (KS ,UAE), so want to know stores ID.


texts: How to load 1587 classes from single file in magento 2?

texts:
I'm integrating Magento 2 with NetSuite CRM.
I'm following this GitHub doc
I want all of the services provided in there
There are 3 files
 1. NSconfig.php
 2. NSPHPClient.php
 3. NetSuiteService.php

The third one files contain 1,41,203 line of PHP code with 1587 classes.

How can I use it in Magento 2 and write every class in a single file and load each of them programmatically?

Any idea or suggestion would be great for me.

Thanks in advance.


texts: How to add attribute options value in Magento2 Programmatically?

texts:
How to add attribute options value if not exist in magento2 programmatically...

I am using dropdown attribute and I want to add dynamic options if not exist in dropdown .. and set product data...

Here is my code but not working: VendorName = 'ACER'

if(isset($pdata['VendorName']) && !(empty($pdata['VendorName']))){
   $_product->setVendorName($pdata['VendorName']);
}


texts: How to handle Magento large customer records

texts:
In my Magento customer have 4.0 laksh records,i want to list the all customer in custom admin form select field

Field

$fieldset->addField('user_id', 'select', array(
            'type' => 'int',
            'label'     => Mage::helper('catalog')->__('Lawyer'),
            'class'     => 'required-entry',
            'required'  => false,
            'name'      => 'user_id',
            'values'    =>$this->LawyerCollection(),
        ));

My Query:

public function LawyerCollection() {
    $collection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('firstname')->addAttributeToFilter('group_id',array('eq'=>5));
        $user = array();
        if($collection->getSize()) {
            foreach($collection as $_collection) {
               $user[$_collection->getId()] = $_collection->getFirstname();
            }
         }
       return $user
}

But the result is an empty page, i hope this is because of the 4.0 record, i tested with with 1000 records it was working fine,now it is not working.

My idea is, i like to do the field with "auto complete", but i don't have any idea to implement the auto suggestion in the admin custom field.

if you have any other idea means kindly let me know,thanks in advance for your answer.


texts: Can't download sample data from ssh anymore

texts:
I've always downloaded sample data from this link:

  http://www.magentocommerce.com/downloads/assets/1.9.1.0/magento-sample-data-1.9.1.0.tar.gz

But today I got 404.

I've read this answer (https://magento.stackexchange.com/a/58031/4276) from Fabian Blechschmidt, which explains how you can download whatever you want with MAGEID and Download Access Token. But sample data was not included.

If you run:

  curl
  https://MAGEID:ACCESS_TOKEN@www.magentocommerce.com/products/downloads/info/files

You'll get:

So where can I download sample data over ssh?


texts: I need to rewrite all my category urls. they are more than 600X so it is not possible to set them one by one. how can i set them automatically?


texts:
What is the error message:

  Required parameter 'theme_dir' was not passed

Is it related to in Magento 2? And how can this problem be fixed?


texts: How to get a category thumbnail or Image?

texts:
I am stuck at this point. I want to display a grid of categories thumbnail/image

var_dump($_category->getData('thumbnail')); return NULL

Even when I do var_dump($_category->getData());
here is what's return

array(16) { ["entity_id"]=> string(1) "3" ["entity_type_id"]=>string(1) "3"
["attribute_set_id"]=> string(1) "3" ["parent_id"]=> string(1) "2"
["created_at"]=> string(19) "2014-12-15 18:49:50" ["updated_at"]=> string(19)
"2014-12-15 19:09:30" ["path"]=> string(5) "1/2/3" ["position"]=> string(1)
"1" ["level"]=> string(1) "2" ["children_count"]=> string(1) "0" ["path_id"]=>
string(5) "1/2/3" ["is_active"]=> string(1) "1" ["include_in_menu"]=>
string(1) "1" ["request_path"]=> string(14) "vegetable.html" ["name"]=>
string(9) "Vegetable" ["url_key"]=> string(9) "vegetable"}

this is my code

<?php $_helper = Mage::helper('catalog/category') ?>
<?php $_categories = $_helper->getStoreCategories() ?>
<?php if (count($_categories) > 0): ?>

    <?php foreach($_categories as $_category): ?>

            <a href="<?php echo $_helper->getCategoryUrl($_category) ?>">
                <?php echo $_category->getName(); // this works?>
                <?php var_dump($_category->getData('thumbnail')) // return null?>

    <?php endforeach; ?>

<?php endif; ?>


texts: How to show Header content on checkout page in magento2?


texts:
I created an Plugin to change the category links from ?catId=xxx to the real category name.

My Plugin look like this:

   class CategoryPlugin
{
    /**
     * Url
     *
     * @var \Magento\Framework\UrlInterface
     */
    protected $url;

    /**
     *
     * @var \Magento\Catalog\Model\Category
     */
    protected $category;

    /**
     * Construct
     *
     * @param \Magento\Framework\UrlInterface $url
     * @param \Magento\Catalog\Model\Category $category
     */
    public function __construct(
        \Magento\Framework\UrlInterface $url,
        \Magento\Catalog\Model\Category $category
    ) {
        $this->url = $url;
        $this->category = $category;
    }

    public function afterGetUrl(
        \Magento\Catalog\Model\Layer\Filter\Item $item,
        $resultUrl
    ) {
        //this code change the category links name to a freandly SEO Llinks
        if($item->getFilter()->getRequestVar() == "cat") {

            $return = $this->category->load($item->getValue())->getUrl();
            $request = $this->url->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);

            if(strpos($request,'?') !== false ) {
                $query_string = substr($request,strpos($request,'?'));
            } else {
                $query_string = '';
            }

            if(!empty($query_string)) {
                $return .= $query_string;
            }

            return $return;
        }

        return $resultUrl;
    }
}

When this code it's run, all the category has the same name, and it goes in the same link direction(the name and the location corespond with the first category name)

So now all my category have the same name as the first category.

If i try to modify  getUrl() function in vendor location(\vendor\magento\module-catalog\Model\Layer\Filter\Item.php), everything works fine.

Does anyone know if the behaviour of the Plugin not allowed me do this thing? Or why the same function works fine in the vendor and in plugin not?


texts: How can i set product custom options by observer event(checkout_cart_after_add_product) in magento 2

texts:
Below code i am doing.

$item = $observer->getEvent()->getData('quote_item');
$item = ( $item->getParentItem() ? $item->getParentItem() : $item );
$price = 100;
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);


texts:
I try to view or reindex the indexer by SSH.
I get always the same response:

xxxx:/home/www/xxxx/html/shell > php -f indexer.php -- status all
X-Powered-By: PHP/5.6.5
Content-type: text/html; charset=UTF-8

Usage:  php -f indexer.php -- [options]

  --status <indexer>            Show Indexer(s) Status
  --mode <indexer>              Show Indexer(s) Index Mode
  --mode-realtime <indexer>     Set index mode type "Update on Save"
  --mode-manual <indexer>       Set index mode type "Manual Update"
  --reindex <indexer>           Reindex Data
  info                          Show allowed indexers
  reindexall                    Reindex Data by all indexers
  help                          This help

  <indexer>     Comma separated indexer codes or value "all" for all indexers

I can try out all the possible combinations. Still get the same "help" response.
What jam doing wrong?

php indexer.php --status all
php indexer.php -status all
php indexer.php status all
php -f indexer.php --status all
php -f indexer.php -status all
php -f indexer.php status all

The same with "info" or "reindex" and the other commands.


texts: problem with reindex more than 500,000 SKU

texts:
My magento website installed multi-warehouse extension. The concept of this extension is generating all product separate for each warehouse. and this make my db is very big. so far I check my database more than 500,000 product sku generated.

Problem is when I reindex, it alway error even I use SSH command. these 2 table I got a problem when reindex:

catalog_product_attribute
catalog_product_price

I already upgrade server to cloud but it may not enough. I found this extension:
https://mirasvit.com/magento-extensions/magento-asynchronous-reindex.html

but not sure it work or not. Anyone who had experience on this extension and try with huge database pls recommend.

Thank so much


texts: Magento 2.2.5: How to get something (students,teachers,products) by id

texts:
i'm doing update "students" on magento 2.2.5
and i'm stuck in how to get student data by id
i saw they use repository to load by id, but when i come in this file

C:\xampp\htdocs\magento\vendor\magento\module-catalog\Model\ProductRepository.php

they using factory to load by id

here is my students table in mysql:

but with what i search for, the load() method in factory is cant be use anymore.
so i wanna ask how to how to get student data by id

my code for now:

<?php

namespace Fudu\HelloWorld\Controller\Adminhtml\Student;

use Magento\Backend\App\Action;
use Fudu\HelloWorld\Model\StudentsFactory;
use \Magento\Framework\Exception\NoSuchEntityException;

class Update extends Action
{
    /**
     * @var StudentsFactory
     */
    protected $studentsFactory;

   public function __construct(
       Action\Context $context,
       StudentsFactory $studentsFactory
   )
   {
       $this->studentsFactory = $studentsFactory;
       parent::__construct($context);
   }

/**
 * Load Student data by given Student Id
 *
 * @return $student
 * @throws NoSuchEntityException
 */

public function execute()
{
    $id = $this->getRequest()->getParam('id');
    $student = $this->studentsFactory->create();
    $student->load($id);
    return $student;
}
}


texts:
I want to change store by location in magento. For that I create a popup of location dropdown when user open website in there browser, here user selects its location and website redirect to particular store.

public function getLocationInfoByIp($observer) {

        $location = $_POST['location'];
        switch ($location) {

            case "US": {
                  Mage::app()->setCurrentStore('en');
                  break;
            }
            case "IN": {
                Mage::app()->setCurrentStore('de');
                break;
            }
            default: {
                Mage::app()->setCurrentStore('en');
                break;
            }
       }
 }

When I submit popup after selecting location from dropdown, It change store. But after refresh it again change store to default.

So please suggest to resolve this issue.


texts: Is it possible to somehow return a value parameter in a POST request using Magento2?

texts:
I want to return value from magento2 when creating an attribute option,
I make such a request with method POST

    {
  "option":
        {
              "label": "Pavel",
              "value": "option_x",
              "sort_order": 0,
              "is_default": true

        }
}

The response value comes from the value of my request, that is, option_x, can I somehow set the id value that will be returned from the created option ?
I want the id created option from magento to be returned to me


texts:
My shop was moved to a server without mcrypt and for some reason mcrypt can not be installed (don't ask me why!).

Looks like passwords are only encrypted with md5 with a salt (bad!) so I wonder what mcrypt is used for at all. Someone hacked Magento and was able to install it without mcrypt. Does not sound good to me but it was working for him.

Now i would like to know what for encrypt is used and will the show break if I replace it with a dummy? Is there a better workaround? May get secure random from openssl and add an encryption lib?

TL;DR

What is mcrypt used for in Magento?
Is a good workaround possible?


texts: Add custom text/price to product edit in admin (not custom attribute or editable field)

texts:
I have a shop that uses prices excl tax.
I want to add the price incl. tax below the price field as text (not as an editable field or an attribute, just an information).

I've already added a new column to the product grid that shows the price incl tax (using a renderer that returns $this->helper('tax')->getPrice($product, $product->getFinalPrice(), true);)

But I just can't figure out how to get this working on the product edit price tab?  If I had to add an attribute I think it could be added in the Attributes.php (Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes), but can I add an info-block/comment/line of text?

It doesn't have to calculate it realtime the price when you enter a price in the price field, just on save/load of the product (with php)?

To sum up, how do i add a custom comment/info text below the price field?

I want to show $this->helper('tax')->getPrice($product, $product->getFinalPrice(), true); in this comment/info text.


texts: Magento2 deploy static files overwrite instead of manually delete

texts:
When I run bin/magento setup:static-content:deploy
it does not overwrite existing files but leaves them intact.

This leads to the unpleasant situation that I have to clear static file before I regenerate them. In the meantime my store is unaccessible.
It would be so much easier if the files would remain in place and then just overwritten when the new file comes in.

Does anyone have a working solution for this?


texts: The "Order" button in onepage checkout doesn't work

texts:
I'm trying to setup a web store using Magento 1.8. Onepage chekout got stuck in the payment methods. Following the workflow outlined here http://www.magentocommerce.com/boards I fixed that issue, however now when I arrive at the "order review" step the "Order" button doesn't work. There are no errors in the JS console.

Can someone help?


texts: I faced the error while search any string Magento 2

texts:
When I search for any string in Magento2 then there is result page showing blank. I got the exception.log file.

  "[2018-06-01 08:57:23] main.CRITICAL: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list, query was: SELECT search_synonyms.* FROM search_synonyms WHERE (MATCH (synonyms) AGAINST ('9898' IN BOOLEAN MODE)) {"exception":"[object] (Zend_Db_Statement_Exception(code: 0): SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list, query was: SELECT search_synonyms.* FROM search_synonyms WHERE (MATCH (synonyms) AGAINST ('9898' IN BOOLEAN MODE)) at /opt/lampp/htdocs/magento223/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: HY000): SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list at /opt/lampp/htdocs/magento223/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []
  "


texts:
I am trying to setup XHProf in nginx server but some of reason I am unable to success.
I follow and read XHProof magento 2 Any one try and success to configure it.


texts: get custom address attribute value from order in Magento 2

texts:
I have created 2 address attributes using data patch.
Vendor/Module/Setup/Data/Patch/Latitude.php
use Magento\Customer\Model\Indexer\Address\AttributeProvider;
use Magento\Customer\Setup\CustomerSetup;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Eav\Model\Entity\Attribute\Set;
use Magento\Eav\Model\Entity\Attribute\SetFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchRevertableInterface;

class AddLatitudeCustomerAddressAttribute implements DataPatchInterface, PatchRevertableInterface
{
private $moduleDataSetup;
private $customerSetupFactory;
private $attributeSetFactory;
public function __construct(
    ModuleDataSetupInterface $moduleDataSetup,
    CustomerSetupFactory $customerSetupFactory,
    SetFactory $attributeSetFactory
) {
    $this->moduleDataSetup = $moduleDataSetup;
    $this->customerSetupFactory = $customerSetupFactory;
    $this->attributeSetFactory = $attributeSetFactory;
}

/**
 * {@inheritdoc}
 */
public function apply()
{
    $this->moduleDataSetup->getConnection()->startSetup();
    /** @var CustomerSetup $customerSetup */
    $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]);
    $customerEntity = $customerSetup->getEavConfig()->getEntityType(AttributeProvider::ENTITY);
    $attributeSetId = $customerEntity->getDefaultAttributeSetId();

    /** @var $attributeSet Set */
    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

    $customerSetup->addAttribute(AttributeProvider::ENTITY, 'latitude', [
        'type' => 'varchar',
        'label' => 'Latitude',
        'input' => 'text',
        'source' => '',
        'required' => true,
        'visible' => true,
        'position' => 333,
        'system' => false,
        'backend' => ''
    ]);

    $attribute = $customerSetup->getEavConfig()->getAttribute(AttributeProvider::ENTITY, 'latitude');
    $attribute->addData([
        'used_in_forms' => [
            'adminhtml_customer_address',
            'customer_address_edit',
            'customer_register_address'
        ]
    ]);
    $attribute->addData([
        'attribute_set_id' => $attributeSetId,
        'attribute_group_id' => $attributeGroupId

    ]);
    $attribute->save();

    $this->moduleDataSetup->getConnection()->endSetup();
}

public function revert()
{
    $this->moduleDataSetup->getConnection()->startSetup();
    /** @var CustomerSetup $customerSetup */
    $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]);
    $customerSetup->removeAttribute(\Magento\Customer\Model\Customer::ENTITY, 'latitude');

    $this->moduleDataSetup->getConnection()->endSetup();
}

/**
 * {@inheritdoc}
 */
public function getAliases()
{
    return [];
}

/**
 * {@inheritdoc}
 */
public static function getDependencies()
{
    return [

    ];
  }
 }

The attribute is created, Now I written an observer to get the custom address attribute.
Vendor/Module/etc/events.xml
<event name="sales_order_save_after">
    <observer name="sales_order_save_after"
              instance="Vendor\Module\Observer\SalesOrderAfterSave" />
</event>

Vendor\Module\Observer\SalesOrderAfterSave.php
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
      $orderData = $observer->getEvent()->getOrder();
      if ($orderData) {
        $shippingAddress = $orderData->getShippingAddress()->getData();
        $latitude= $shippingAddress['latitude'];
       }
    }

In the above code unable to get $latitude value from the shipping address, can anyone help me how to get the custom address attribute. Thanks in advance!!.


texts: Coupon not working in Magento 1.9.3.1 with HHVM and PHP 7

texts:
I just upgraded my Magento from 1.9.2.4 to 1.9.3.1. FYI, I'm using HHVM 3.15 not Zend. Everything works fine, except for the coupon. I noticed even when using vanilla installation, problem exists.

I tried to dig deeper with the couponPostAction() method (Mage_Checkout_CartController) and pay attention to this line:

$this->_getQuote()->setCouponCode($isCodeLengthValid ? $couponCode : '')->collectTotals()->save();

I also checked the sales_flat_quote table and found that subtotal_with_discount and base_subtotal_with_discount fields are already correct, however the the grand_total and base_grand_total are not because both are still showing the original amount.

I couldn't figure it out why the quote model didn't calculate the discount amount and save to grand_total and base_grand_total correctly.

Any help would be appreciated.

EDIT: I tried with PHP 7 and the problem appears to be the same. It works on PHP 5.5


texts: Get product collection from a category id

texts:
I am trying to get a collection of products from a category id.  A few things I have tried are in the block :

 $category = Mage::getModel('catalog/category')->load(123)
        ->getProductCollection();

and

    $category = Mage::getModel('catalog/category')->load(123);
    $products = $category->getProductCollection()->addCategoryFilter($category)
                         ->addAttributeToFilter('type_id', 'simple')
                         ->addAttributeToSelect('*');

also tried just doing it from the phtml

$oCatId = Mage::getModel('catalog/category')->load(769);
        $products->addCategoryFilter($oCatId);

None of this works but I am not seeing any errors either.    I saw another post that seems like the same question : Magento - Get Products from Specific Category but that method did not work for me either.  Thanks for any help!


texts: Export configurable products with associated simples in one csv

texts:
I'm not quite sure how this is done. I want to export a csv with configurable products along with the associated products. Then I would like to import them over on another magento install. How is this done? and is there a way around getting an extension? I have already tried
http://www.magelynx.com/checkout/cart/configure/id/1166/
but that didn't work.


texts: Programmatically update database after successfull checkout

texts:
I am creating a custom payment module using paypal api(Dont want to use any Magento Paypal Module). I am able to make the module work till the payment made. But I cant able to do the database update ,with the cart item, while coming back from paypal after successful checkout,with response.
Please help me how can I update the database while the checkout process is completed and return from Paypal.


texts: Multiple stores: How to accomplish this?

texts:
I am working for a company, and we are looking to expand to another domain that we own. We have a couple in house servers for testing that mimic the live server. We have at any given time up to ten "play" sites on a box, including the live server (although we don't use the live server for any play sites unless we are getting outside help.)

The conditions are:

Each play site has its own virtualhost entry in the httpd.conf file
Each play site has its own directory in /var/www

ie. play1 is in /var/www/play1, where as play2 is in /var/www/play2

All play sites have their own IP address (whether on the internal net or internet, doesn't matter)
We are able to assign as many IP's as needed to a single box
We do not use wildcard entries in our virtualhost entries
We want separate themes for each domain/store, while sharing the customer database between sites/stores.

In our attempts to do this on our own, we are able to get the Magento install to use both IP addresses we assign to it, but when we try to differentiate, Magento doesn't do anything regarding the theme, catalog, or anything. It just shows us the same site on both IP addresses, even after defining the Base URL for each store.

I am under the impression that some core files regarding the themes were modified when the original webmaster created the site. I can provided copies of files upon request.


texts: How can I import product image from an external URL in magento 1.9

texts:
$simpleProduct = Mage::getModel('catalog/product');
$simpleProduct->setMediaGallery (array('images'=>array (), 'values'=>array ()));

Please help me.


texts: Hey magento 2x developer does anybody integrate website with daraz.pk website for products for one time process using api the documentation is there does anybody integrated for one time. Magento current version is 2.2. Please inform asap.


texts: Fetch the Ordered Products through collection

texts:
Background :

I can able to display the Customer's Orders in excel sheet....

Requirement :

Now I am trying to get the Ordered Product skus in excel sheet...

Issue :

Notice: Undefined variable: sku

<?php

$customerCount = 0;
try{
    //configure the collection filters.
    $collection = Mage::getResourceModel('customer/customer_collection')
    ->addAttributeToSelect('entity_id')
    ->addAttributeToSelect('firstname')
    ->addAttributeToSelect('email');

    do{
         //Tell the collection which page to load.
         $collection->setCurPage($currentPage);
         $collection->load();
         foreach ($collection as $customer){
             $customerArray = $customer->toArray();

  $newordercollection = Mage::getModel("sales/order")->getCollection()->addFieldToFilter('customer_id',$customerArray['entity_id']);
  $collection->setOrder('entity_id', 'ASC');
  $firstItem = $newordercollection->getFirstItem();
  $orderID = $firstItem->getIncrementId();

        foreach ($newordercollection as $orderkey => $ordervalue)
        {
             foreach ($ordervalue->getAllVisibleItems() as $item)
              {
                $name = $item->getName();
              }
              $eid = $ordervalue->getOrderId();
              $order = Mage::getModel("sales/order")->load($eid);
        }
            //write the collection array as a CSV.

            $customerREquiredArray['customer ID'] = $customerArray['entity_id'];
            $customerREquiredArray['First name'] = $customerArray['firstname'];
            $customerREquiredArray['Email'] = $customerArray['email'];
            $customerREquiredArray['order id']= $orderID;
            $customerREquiredArray['products']= $name;
            $customerCount++;
    }
}

Full code : https://pastebin.com/2bHGSZiw


texts: Magento 2: How to add extenstion attributes for the ProductCustomOptionValuesInterface

texts:
I need to add product custom added Customizable Options to the product Rest API. I have set that custom options to the below core Interface Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface and Model Magento\Catalog\Model\Product\Option\Value file and options in getting in product API.

But can't override interface so how to add as extension attributes or other override solution for below core dependency.

Core dependency file path: magento231\vendor\magento\module-catalog\etc\di.xml

<preference for="Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface" type="Magento\Catalog\Model\Product\Option\Value" />

I have find the issue from github. Can't able to add extenstion attributes for Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface

Github Issue link:
https://github.com/magento/community-features/issues/30

Any help would be appreciated. Thanks!


texts: Magento-2: passing arguments in layout xml to block

texts:
I need to understand some doubts facing in Magento-2. I need to display price(same as displayed in product description page) in my custom phtml file. I have a custom layout xml file which has declared some blocks and its associated templates, but after some line arguments are being passed in that. For example:

<block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart" name="customer.wishlist.item.price" template="item/column/price.phtml" cacheable="false">
                    <block class="Magento\Catalog\Pricing\Render" name="product.price.render.wishlist">
                        <arguments>
                            <argument name="price_render" xsi:type="string">product.price.render.default</argument>
                            <argument name="price_type_code" xsi:type="string">configured_price</argument>
                            <argument name="price_label" xsi:type="boolean">false</argument>
                            <argument name="zone" xsi:type="string">item_list</argument>
                        </arguments>
                    </block>
                    <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Options" name="customer.wishlist.item.options" cacheable="false"/>
                </block>

This code is from wishlist_index_index.xml file. Where are these arguments passed, what are these arguments and how this will work for displaying price in wishlist page?
Take one more example:

<block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices">
    <arguments>
        <argument name="default" xsi:type="array">
            <item name="default_render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item>
            <item name="default_render_template" xsi:type="string">Magento_Catalog::product/price/default.phtml</item>
            <item name="default_amount_render_class" xsi:type="string">Magento\Framework\Pricing\Render\Amount</item>
            <item name="default_amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
            <item name="prices" xsi:type="array">
                <item name="special_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/special_price.phtml</item>
                </item>
                <item name="tier_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/tier_prices.phtml</item>
                </item>
                <item name="final_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/final_price.phtml</item>
                </item>
                <item name="custom_option_price" xsi:type="array">
                    <item name="amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
                </item>
                <item name="configured_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\ConfiguredPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/configured_price.phtml</item>
                </item>
            </item>
            <!--<item name="adjustments" xsi:type="array"></item>-->
        </argument>
    </arguments>
</block>

This code is from catalog_product_prices.xml file. Here, we pass items to arguments. What are these items in arguments and how is it going to work**?????**


texts: Get collections with simple and grouped products with all activate

texts:
I need to get a collection of products between simple products and grouped products but the grouped products need have all those associated products active.

Any idea?.

Thank you!.


texts: I want to Add New Shipping Carrier in the Shipping ->Shipping and Tracking Information->Drop-down. so how I can I add extra shipping carriers.


texts: Magento 2 Move left sidebar Customer menus list to somewhere

texts: Anyone know how to move left sidebar's Customer menu list to right sidebar?


texts: How do I add a js reference to the body of my page and a css reference to the head of my page?

texts:
The only place I have access to edit is: CMS > Pages > 'page' > Content

Can I add a jquery reference to the body of my page like this in the content area?

<body>
<script src="js/jquery.min.js"></script>
<script src="js/image-map-pro.min.js"></script>
</body>

And then, how would I add a css reference to the head of my page?

<head>
<link rel="stylesheet" href="css/image-map-pro.min.css">
<link rel="stylesheet" href="css/squares.min.css">
</head>

Thanks in advance!


texts:
Recently I bought a magento theme, Its currently LTR (Left-To-Right), but I would like use it in multilingual store which supports Engish (LTR) and Persian (RTL) languages.

Is there any rule for this condition in magento? for example in drupal each CSS files can have [main-css]-rtl.css version and in WordPress we can have rtl.css file to make theme Bi-directional.

Where should I start?


texts: Magento 2 - disable sale for product by plugin or event

texts:
The product has attribute "is_special_action". I need to disbale product for sale if this attribute equals 1.

I suspect we can use CustomModule\Plugin\Catalog\Model\Product.php class, add this plugin to di.xml

But what events will used in plugin?

Many thanks for any help :)


texts: How to handle static asset generation in production?

texts:
I'm wondering how to handle the setup:static-content:deploy command in production efficiently, right now I'm running the command after setup:upgrade however I run into an issue where frontend assets are missing for a few seconds before the static content is finished generating.

I tried running setup:upgrade --keep-generated so static content doesn't get cleared, however if the static assets already exists it looks like the setup:static-content:deploy command ignores them and doesn't update them with new changes. As far as my tests go it seems that I need to clear the static folder so files with new changes get generated.

I know it's possible to generate assets on a build server after 2.2, so we don't have to run this process on the production server, but looking at the options this seems to rely on copying these assets manually (by adding them to source control, copying them via rsync, scp, etc).

Knowing this my main question is: is there a way to make setup:static-content:deploy overwrite the already existing assets with the new ones without clearing them first? This would avoid all the issues I'm having.


texts: Magento 1.9 - Programatically achieve layered navigation filter selecting maultiple options per attribute

texts: How can i programmatically achieve the multi select options per attribute in layered navigation. Can't use plugins for this. Because am using Dependant plugins with the layered navigation. Like infinite scroll plugin, Advanced search plugin.


texts:
I have added extra data to be display before subtotal in INvoice PDF but not display properly
Following is my code I added
foreach ($invoice->getAllItems() as $item) {
                if ($item->getOrderItem()->getParentItem()) {
                    continue;
                }
                /* Draw item */
                $this->_drawItem($item, $page, $order);
                $page->setLineColor(new \Zend_Pdf_Color_GrayScale(0.5));
                $page->setLineWidth(0.5);
                $page->drawLine(25, $this->y+12.5, 570, $this->y+12.5);
                $page = end($pdf->pages);
            }
            $this->insertText($page,$order->getGiftMessageId());
            /* Add totals */
            $this->insertTotals($page, $invoice);
            if ($invoice->getStoreId()) {
                $this->_localeResolver->revert();
            }

Where $this->insertText($page,$order->getGiftMessageId()); is my custom function
Also, following is the data for this function
public function insertText($page,$giftid)
    {
         $page->drawLine(25, $this->y, 570, $this->y);
         $this->y -= 25;
         $lines = [];
         $_giftMessage = $helper = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\GiftMessage\Helper\Message')->getGiftMessage($giftid);
         if (!empty($_giftMessage->getSender())) {
            $page->drawText('Gift Message for this Order 2', 35, $this->y, 'UTF-8');
            $page->drawText('From:', 35, $this->y-26, 'UTF-8');
            $page->drawText($_giftMessage->getSender(), 65, $this->y-40, 'UTF-8');
            $page->drawText('To:', 35, $this->y-50, 'UTF-8');
            $page->drawText($_giftMessage->getRecipient(), 65, $this->y-60, 'UTF-8');
            $page->drawText('Message:', 35, $this->y-75, 'UTF-8');
            $page->drawText($_giftMessage->getMessage(), 65, $this->y-90, 'UTF-8');
            }
    }
}

The custom data gets hidden


texts: Import Database Error: #1062 Duplicate entry '3-13-70-0' for key

texts:
I am attempting to export the Magento database from my current installation to a test installation before I have the test installation go live. Both installations are version 1.9.2.1. I can successfully export the database. I've tried two methods of importing it. The first via SSH after uploading it via FTP to the server. The next via phpMyAdmin after exporting it as a gzip file first. I have to do it via a gzip file for phpMyAdmin because the database is way too big otherwise. For both SSH and phpMyAdmin, I get this same error with trying to import the database...

When done via SSH, the line in the picture under "My SQL said:" is what appears. phpMyAdmin seems to show a little more info. I have no idea what this error is all about. I emptied all of the logs from the tables as well as the admin notifications table. I just can't understand where this error is coming from.

Am I missing something? Do I need to delete all of the tables from the target database before importing the one from my live site? I feel like there's something simple that I'm overlooking or not doing correctly.


texts: Lock Timeout when saving/login customer in Magento 2.3

texts:
When some of my customers try to log in or when I try to update their data in Magento 2, the transaction get stuck and we end up having an error of the type:

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: UPDATE `customer_entity` SET `website_id` = ?, `email` = ?, `group_id` = ?, `store_id` = ?, `created_at` = '2014-11-18 11:30:34', `updated_at` = '2020-06-03 09:02:11', `disable_auto_group_change` = ?, `created_in` = ?, `firstname` = ?, `lastname` = ?, `password_hash` = ?, `rp_token` = ?, `rp_token_created_at` = ?, `default_billing` = ?, `default_shipping` = ?, `taxvat` = ?, `confirmation` = ?, `failures_num` = ?, `first_failure` = ?, `lock_expires` = ? WHERE (`entity_id`=904)

There are different questions in stackoverflow talking about this. There is even a supposed fixed magento bug:

https://github.com/magento/magento2/issues/10783
Something went wrong while saving the customer?
Magento 2.3.3 customer password update after customer login not working

The issue seems to be related to a lock that comes from I don't know where. It affects some clients, not all of them. What is interesting is that even if I execute this directly in the database:

update customer_entity set group_id='2' where entity_id = '4678';

(same id that created generated the lock)

It gets stuck. I doesn't complete the query and it waits and waits.

Anyone could have any idea where the issue might come from?


texts: Magento 2.3.4 paypal in-context is not working?

texts:
Website redirecting to paypal, but I want show paypal popup without redirection to paypal.
I want to enable paypal popup on checkout page during order placed.
I have enabled In-Context Checkout Experience in the configuration but it is not working.
I am using Sandbox Mode to testing this.
How can I do this?


texts: Magento 2 How to override extension frontend template file?

texts:
I have one extension and it has the following file:
app/code/[Namespace]/[Module]/view/frontend/templates/test.html

I want to override that specific file in my theme:
app/design/frontend/[Namespace]/[ThemeName]

So how can I do that please help me.


texts: "Reset filter" button missing in admin panel completely

texts:
I have used "Reset Filter" button before in various screens, now i tried to add related products and I am not able to add it as I couldn't find the "Reset Filter" button and also no way to search for the products in the screen. It happens to category page as well to add new products to category. Not sure what happened.

Running 1.9.2 (Stable)


texts: magento 1.9 Add video in email templates

texts:
Does anyone know how to add video in email template

I am working on transactional email template in Magento.
I want to add video in my email template.
I have added using an iframe. But it's not showing in the email.


texts:
I want to hide out of stock products from showing in search or category pages and I do not want to use the built in feature:

Admin >> System >> Configuration >> Catalog >> Inventory >> Stock Options
Display Out of Stock product -> No

The reason is that I use and sort out of stock products and if I disable them completely I can't filter by Stock status.

How do I put a filter on the category and search collection?


texts: Magento 2 : How to set product stock status customer group specific?

texts:
My requirement is wholesaler can order out of stock prdocuts.
I tried to create a plugin for the below file but didn't work.

\Magento\CatalogInventory\Helper\Stock::addIsInStockFilterToCollection

Please help me how can I set the stock status to customer group-specific?
Thank you.


texts: How to get additionnal options product from quote item

texts:
I have some Vitrual product with options, I need to get his options but I can just get the info_buyRequest instead of additional_options

Here is my code:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

//This doesn't work
$itemsCollection = $cart->getQuote()->getItemsCollection();

//This doesn't work too
$itemsVisible = $cart->getQuote()->getAllVisibleItems();

//This return something
$items = $cart->getQuote()->getAllItems();

foreach($items as $item) {
    echo 'ID: '.$item->getProductId().'
';
    echo 'Name: '.$item->getName().'
';
    echo 'Sku: '.$item->getSku().'
';
    echo 'Quantity: '.$item->getQty().'
';
    echo 'Price: '.$item->getPrice().'
';
    echo "
";
}

//Here I try to get the product options but no way

$items = $cart->getQuote()->getAllItems();

foreach ($items as $item) {
    $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
    $customOptions = $options['options']; // error here, line 44
    if (!empty($customOptions)) {
        foreach ($customOptions as $option) {
            $optionTitle = $option['label'];
            $optionId = $option['option_id'];
            $optionType = $option['type'];
            $optionValue = $option['value'];
        }
    }
}

Error:

  Exception #0 (Exception): Notice: Undefined index: options in
  /app/code/Vendor/Module/view/frontend/templates/file.phtml
  on line 44

  quote_item_option table > additional_options code


texts: How to add a product description on home page block?

texts:
I just wondering if it is possible to show exact product "explored" just on front page (without URL's forwarding or something like this) ?

I.e. User should visit my site and immediately see product description, without clicking on product itself.


texts: M2: after add to cart showing error message

texts:
After add to cart, product added to cart and showing this "We can't add this item to your shopping cart right now." error message.

I have set website and all other necessary fields for product in admin panel.

in exception.log file, showing this details:

report.CRITICAL: Magento\Framework\Exception\NoSuchEntityException: Requested store is not found in /XXX/XXX/vendor/magento/module-store/Model/StoreRepository.php:111

I have already done re indexing, commands, cache but still above error message is showing.

I have already review this: //magento.stackexchange.com/questions/200031/we-cant-add-this-item-to-your-shopping-cart-right-now-on-detail-page-magento


texts: Can I make Soap V1 Api Calls from a magento 2. version?

texts: Was wondering if I could use the magento SOAP v1 API to consume data from a magento 2 version store.


texts: Mage report showing security patch SUPEE8788 is not patched but i have copied all files to magento root

texts:
Mage report showing security patch SUPEE8788 is not patched but I have copied all files to Magento root.

I have download zip of SUPEE8788 and extract into Magento root and delete swf files from skin folder as directed on mage report and other sites.

Please help me for above issue.

Thanks in advance.


texts:
If you log in to an account, then view "My Account", when click a link named My Downloadable Products in the left nav area, it gives 404 Not Found.  URL for this is siteurl /downloadable/customer/products/

I got this error message while this happens:

  2018/01/31 15:07:55 [error] 22514#0: *113332 "/home/abc/magento/downloadable/customer/products/index.html" is not found (2: No such file or directory), client: 121.59.59.001, server: siteurl.com, request: "GET /downloadable/customer/products/ HTTP/1.1", host: "siteurl.com", referrer: "siteurl.com/customer/address/"

Why this should happen while this works good on other site?


texts: How to export a specific order in Magento 1

texts:
I created a button to  export a specific order from admin. This button apper on each order.
 Then i created a function that look like this:

public function expButtonAction()
    {
        Mage::app('admin');
        umask(0);
        Mage::app();
        $filename = '/var/www/html/var/varexportEnabled220217.csv';
        $collection = Mage::getModel('sales/order')
                            ->getCollection()
                            ->addAttributeToSelect('*');

        if($collection->count() == 0){
            echo "No products found
";
            exit();
        }
        $i = 0;
        //$hasArgs = isset($argv[1])&& isset($argv[2]);
        echo "Nr. produse: " .count($collection) . "
";

        if($fh  = fopen($filename, 'w')) {

            foreach($collection as $product) {

                $row = array();
                $product = Mage::getModel('catalog/product')->load($product->getId());
                $qtyStock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
                print_r($qtyStock);die();
                $status = $product->getAttributeText('status');
                $isInStock = $product->getStockItem();
                $hasRealImage = ($product->getSmallImage() != null && $product->getSmallImage() != "no_selection");
                $image = null;
                if($hasRealImage){
                    $image = "da";
                } else {
                    $image = "nu";
                }

                if($isInStock->getIsInStock())
                {
                    $isInStock = "in stock";
                }
                else
                {
                    $isInStock = "not in stock";
                }

                        $row[] = $i.";";
                        $row[] = "D1478.";
                        $row[] = "SETA.";
                        $row[] = "5;";
                        $row[] = "1;";
                        fputcsv($fh,$row);
                        /*if($i == 5) {
                            die();
                        }*/
                        echo $i. "-->" . $product->getSku() . "\n";
                        $i++;
                    //}
                //}
            }
            fclose($fh);
        }

        echo "End Script";
            }

This script take all my product from order, and i can't take the prodcuts details like SKU, name or something else.

For example if i want to take this value : $row[] = $product->getSku(); i recive null value

And i alos want to take only the product form a specific order, not all the product ordered on the site.

Does anyone know how can i take only those products from one order, and also to take the product details?


texts: How to Replace custom attribute into description attribute in Magento 2

texts:
How to Create custom attribute value replace into description attribute.
Ex :- My custom attribute all value replace product details tab means description attribute.
My Custom attribute is local_description.
Here is My code :-

<?php
$_helper = $this->helper(Magento\Catalog\Helper\Output::class);
$_product = $block->getProduct();

if (!$_product instanceof \Magento\Catalog\Model\Product) {
    return;
}

$_call = $block->getAtCall();
$_code = $block->getAtCode();
$_className = $block->getCssClass();
$_attributeLabel = $block->getAtLabel();
$_attributeType = $block->getAtType();
$_attributeAddAttribute = $block->getAddAttribute();

$renderLabel = true;
// if defined as 'none' in layout, do not render
if ($_attributeLabel == 'none') {
    $renderLabel = false;
}

if ($_attributeLabel && $_attributeLabel == 'default') {
    $_attributeLabel = $_product->getResource()->getAttribute($_code)->getStoreLabel();
}
if ($_attributeType && $_attributeType == 'text') {
    $_attributeValue = ($_helper->productAttribute($_product, $_product->$_call(), $_code))
        ? $_product->getAttributeText($_code)
        : '';
} else {
 if($_code == 'description')
{
   $_code = 'local_description';
}

    $_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
}
?>

<?php if ($_attributeValue) :?>
<div class="product attribute <?= $block->escapeHtmlAttr($_className) ?>">
    <?php if ($renderLabel) :?>
        <?= $block->escapeHtml($_attributeLabel) ?>
    <?php endif; ?>
    <div class="value" <?= /* @noEscape */ $_attributeAddAttribute ?>><?= /* @noEscape */ $_attributeValue ?>

<?php endif; ?>

THANKS.


texts: Double quotes change into " in Tiny MCE editor in Magento 2.x

texts:
In Tiny MCE editor on a product page in M2.3, all my double quotes are changed into &quot; after saving.
Example:

<a href="{{store direct_url=&quot;contact&quot;}}">

This breaks the links on the page.

Is it possible to avoid this in an easy way e.g. by an admin setting?
Anybody knows of an editor extension that does the job properly?


texts: I want a button in a vertical menu to go down smoothly as shown in screenshot https://ibb.co/nO610e

texts:
I want all category and close button in a vertical menu to go down and up smoothly as shown https://ibb.co/nO610e

https://www.equipus.com/


texts: How to get product by url_key and store id magento 2

texts:
I am working in magento 2 project.

I need to load product collection by url_key and specific store id. I tried but I am getting issue in store id. I search in stack but didn't get solution.

My Query :

$url = $store->getStore()->getCurrentUrl();
$url_path = parse_url($url, PHP_URL_PATH);
$url_path_parts = array_filter(explode('/', $url_path));
$currenturl = $url_path_parts[1];
$oRewrite = $objectManager->create("Magento\Catalog\Model\Product")->getCollection();
$oRewrite->addAttributeToFilter('url_key', $currenturl, 'left');
$oRewrite->addAttributeToSelect('entity_id');
$oRewrite->addStoreFilter(0); // I tried to set store id but not worked

If I print query of above query I am getting following query:

SELECT `e`.*, IF(at_url_key.value_id > 0, at_url_key.value, at_url_key_default.value) AS `url_key` FROM `catalog_product_entity` AS `e` LEFT JOIN `catalog_product_entity_varchar` AS `at_url_key_default` ON (`at_url_key_default`.`entity_id` = `e`.`entity_id`) AND (`at_url_key_default`.`attribute_id` = '119') AND `at_url_key_default`.`store_id` = 0 LEFT JOIN `catalog_product_entity_varchar` AS `at_url_key` ON (`at_url_key`.`entity_id` = `e`.`entity_id`) AND (`at_url_key`.`attribute_id` = '119') AND (`at_url_key`.`store_id` = 2) WHERE (IF(at_url_key.value_id > 0, at_url_key.value, at_url_key_default.value) = 'holle-pouchy-apfel-mit-karotte-pastinake-90g')

If I add addAttributeToFilter then in query I am getting Inner Join with store id 0 and Left join with store id 2.

I want to get result from store 0. Is it possible to set store id 0 in all   join.


texts: How to display unit after price on the checkout page

texts:
I sell products per different kind of units, like m2, bigbag etc. I would like to display the kind of unit after the price on the checkoutpage. What kind of code do I have to use to display the unit of that product?

I have circled in the screenshot what I want.


texts: How to close modal popup by clicking outside the modal-content in Magento 2

texts:
I have created a popup successfully by using Magento 2 modal code as i added below but now i want to close the popup even customer click on outside the pop-up or blur area.

Is there any existing feature or code can help us to achieve this?

Can anyone help on this.

var showFinanceCaclculator = $('div#finance-pre-calculated-values')
    .modal({
          autoOpen: false,
          buttons: [],
          clickableOverlay: true,
          focus: '',
          innerScroll: false,
          modalClass: '',
          modalLeftMargin: 60,
          responsive: true,
          title: 'Estimated Finance Terms',
          type: 'popup'
         });
        $("#show-finance-button").click(function () {
           showFinanceCaclculator.modal("openModal");
       });


texts:
In Magento 2 when import CSV product how to convert utf8 to Shift_JIS.
How to do this ? please show me detail if you can.


texts:
This title is somehow misleading. I will explain the what I want to achieve.

I know it is possible by default to change the billing address on checkout. Since we are only selling to business clients I kinda want to disable that overall.

The billing address that they provide during the registration should not be editable without us knowing. OR they should not be able to order without a valid VAT id filled in. But even so when they have filled in a valid VAT id we still need to check those (otherwise we have problems with the law).

How it works now :

On viewing our website they can not see prices , after a quick registration we are able to manually see if they have filled in a valid VAT id and therefor putting them in a group manually (since we manually check before allowing them to see prices). When they we have putted them in a group and checked the VAT they can see prices and order. But now everything what happens before has no effect. They can still decide to order without VAT at the checkout and change the address.

Any solutions ?

Would really help me out!


texts: Create a custom category attribute and add it to the menu

texts:
I want to add a custom attribute to categories in menu.

If, in Mage_Catalog_Block_Navigation.php in function _renderCategoryMenuItemHtml I transform

$html[] = ''.$this->escapeHtml($category->getName()) . '';

into

$html[] = '' .$category->getBrand()." ".$this->escapeHtml($category->getName()) . '';

It is working. The brand attribute appears on frontend.

How can I do it the correct way by not editing core files?

I created

Mymodule_Block_Catalog_Navigation.php with

class Mymodule_Block_Catalog_Navigation extends Mage_Catalog_Block_Navigation
{//code I should put here
}

and in config.xml

   <global>
    <blocks>
        <catalog>
            <rewrite>
                <navigation>Mymodule_Block_Catalog_Navigation</navigation>
            </rewrite>
        </catalog>
    </blocks>
</global>

And I'm stuck. how should I extend Mage_Catalog_Block_Navigation to add that code?


texts:
I want to have a stand-alone category without any links to the rest of the shop.

Edit: Trying to add script to  topmenu.phtml but not sure where to put it as using MegaMenu.

topmenu.phtml contents:

&nbsp;&nbsp;
            <?php echo $this->__('MENU') ?>

                <?php echo $this->renderCategoriesMenuHtml(0,0,'','mobile')?>

    <?php $class='class="simple"'; if(Mage::getStoreConfig('buyshoplayout/navigation/menutype')=='megamenu'){?>

    <?php $class=''; }?>

        <ul id="nav" <?php echo $class?>>
            <?php if(Mage::getStoreConfig('buyshoplayout/navigation/home_button')){?>

 <a href="<?php echo $this->getUrl('')?>">

            <?php } ?>

            <?php if(Mage::getStoreConfig('buyshoplayout/navigation/menutype')=='simple'){?>
            <?php echo $this->renderCategoriesMenuHtml(0,0) ?>
            <?php } else { ?>
            <?php echo $this->renderCategoriesMenuHtml(0,0,'','megamenu') ?>
            <?php } ?>

            <?php if(Mage::getStoreConfig('buyshoplayout/navigation/custom_block')){?>

               <?php echo Mage::getStoreConfig('buyshoplayout/navigation/custom_menu_url') ?>" class="level-top">
                    <?php echo Mage::getStoreConfig('buyshoplayout/navigation/custom_menu_title') ?>

                            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('buyshop_header_topmenu_custom_block')->toHtml()?>


texts:
I've had a few scenarios where I've tried to use the cms handles to update a cms page's layout. For example I was trying to use the cms_index_index handle referencing root and setting the page template. This failed and I had to make this layout update via the admin system directly on the homepage cms page display settings.

I've also tried to add a block to reference left using the cms_page handle. Again this failed and I had to implement the layout update via the admin system.

I've read that you can't assign a root template to cms pages. Is that correct and can anyone explain why?

I also wondered if there was a way to enable cms handles to use the standard references such as left, right, root etc? I seem to be able to reference things like head and content just fine.


texts:
I run a store selling digital products and for me it is very important to show customers that my ENTIRE store is safe. Also Google have started to reward sites ussing SSL.
http://googlewebmastercentral.blogspot.se/2014/08/https-as-ranking-signal.html

I would like to use SSL (https) on all my Frontend pages in Magento. I have searched the forum and Google for answers and/or extensions but without result.

Does anyone know how to achieve this? Also, should i except any problems when doing this? I know that the speed will be reduced but that is OK.


texts: Understanding the $code parameter in Mage::app()

texts:
In some code online I see the following line use quite often and I understand it is the initialisation / bootstrapping of the main magento class.

Mage::app()

And in some cases I have seen

Mage::app('admin')

The parameter is $code , which seems a little bit vague given the different code types in magento. Maybe this a store code?

What would I put in this parameter and why? ( for example , why would I use 'admin' instead of leaving it out - and are there any other options ).

Thanks so much , I really appreciate your time.


texts: Free Shipping Limited To A Certain Carrier

texts:
Is there a way to make free shipping for only a certain item and for only "USPS Media Mail".

I.E. I want people to be able to add "product a" to shopping cart and when they see the shipping rates, it should be displayed as follows:

UPS $10.00 USPS
Media Mail: FREE
Priority Mail: $10.00


texts: Admin order create: Shipping same as Billing always checked: can I clear that?

texts:
My situation is the opposite of this question... and my version is 1.7.0.1

When creating a new order in the back end for phone orders, we're finding that the "Same As Billing Address" tickbox is always checked. My shipping staff are sometimes shipping orders incorrectly due to this because somehow, the shipping address actually isn't the billing address.

Of course, I tried editing app/design/adminhtml/default/default/template/sales/order/create/form/address.phtml on line 67 to remove <?php if($this->getIsAsBilling()): ?>checked<?php endif; ?> from the checkbox, but that is absolutely not the solution. :P Yes, the form then comes up NOT checked, but if you then check it, it stays cleared when it should now be changed.

Which makes me think I am looking at the symptom and the problem is elsewhere.

Help, please, in finding a way to uncheck that box at the beginning of the order?


texts:
I have this structure :

|-app/design/frontend
 |-Magento
   |-Theme
     |-layout
       |--default.xml
       |--default_head_blocks.xml
     |-Magento_Theme
       |-templates
     |-web
       |-css
         |--custom-m.css
       |-js
   |-theme.xml
   |-requirejs-config.js
   |-registration.php

In default.xml :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="head">
            <block class="Magento\Theme\Block\Html\Head\Script" name="requirejs" before="-">
                <arguments>
                    <!-- RequireJs library enabled -->
                    <argument name="file" xsi:type="string">requirejs/require.js</argument>
                </arguments>
            </block>
            <!-- Special block with necessary config is added on the page -->
            <block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config" after="requirejs"/>
        </referenceBlock>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_file" xsi:type="string">images/logo.png</argument>
            </arguments>
        </referenceBlock>
        <remove name="report.bugs"/>
    </body>
</page>

And in default_head_blocks.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <css src="mage/calendar.css"/>
        <script src="requirejs/require.js"/>
        <css src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" src_type="url"/>
        <css src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" src_type="url"/>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous" src_type="url"/>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.bundle.min.js" integrity="sha384-u/bQvRA/1bobcXlcEYpsEdFVK/vJs3+T+nXLsBYJthmdBuavHvAW6UsmqO2Gd/F9" crossorigin="anonymous" src_type="url"/>
        <css src="Magento_Theme::css/custom-m.css"/>
    </head>
    <body>
        <referenceContainer name="after.body.start">
            <block class="Magento\Framework\View\Element\Template" name="head.polyfill" as="polyfill" template="Magento_Theme::js/polyfill.phtml" before="-"/>
            <block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Theme::js/components.phtml" before="-"/>
        </referenceContainer>
    </body>
</page>

But my custom-m.css in not detected. Any ideas ?

EDIT :

In fact, the problem is from my default_head_blocks.xml. Bootstrap is not charging inside this (i added cdn in phtml file, but i forgot), so i'll try to figure out the problem


texts: Import Product Image Sort Order Value Using Magmi Or Other Import Tool

texts: I am looking to import multiple product images into Magento using Magmi, however I cant seem to find a way to import the product image sort order attribute along with the image. Does anybody know the easiest way to import product image positions via CSV using Magmi or dataflow profiles or any other tool?


texts: Class "String" does not exist swagger magento 2

texts:
I am working with swagger api but when hit this url :-

http://localhost/magentosetup/swagger

I get the error when I am trying to use api please help.  :-

500 : {"message":"Class \"String\" does not exist. Please note that namespace must be specified.","trace":"#0 \/mnt\/data\/home\/134855.cloudwaysapps.com\/etfeurwasq\/public_html\/vendor\/magento\/framework\/Reflection\/TypeProcessor.php(212): Magento\\Framework\\Reflection\\TypeProcessor->register('String')\n#1 \/mnt\/data\/home\/134855.cloudwaysapps.com\/etfeurwasq\/public_html\/vendor\/magento\/framework\/Reflection\/TypeProcessor.php(181): Magento\\Framework\\Reflection\\TypeProcessor->_processMethod(Object(Zend\\Code\\Reflection\\MethodReflection),


texts: Where do I point my "Secure Base URL for Static View Files" for CDN in Magento 2?

texts:
Currently in Magento 2, deploying on live production we get the following:

/static/version1490119662/frontend/sss/default/en_US/Ves_Megamenu/css/styles.css

Sometimes not always in development and production we see the following:

/pub/static/frontend/sss/default/en_US/Ves_Megamenu/css/styles.css

So for my CDN, where should I point my origin too

/static or /pub

As I need to update my Secure Base URL for Static View Files


texts: How to add DHL shipping tracking for customers?

texts:
I know in "shipping methods" there is a module for DHL but the knowledge-base says "DHL is available for international shipments, but is not used for local shipments". Also it tells me nothing about what the module does. Because of this I think this module is useless for me.

I want the user to view DHL shipping tracking. How can I do this?

Update

You can add a tracking number to an order. Looks like the DHL module will do what I need. Where do I get the account for this DHL API xmlpi-ea.dhl.com?

I installed the official DHL Magento module but it's config page returns a 404 error. Also there is a developer page where you can get an account.


texts: How to use Modules installed with Composer and Firegento in my Magento installation

texts:
This is a super basic Magento/Composer question — how are users (i.e. me) supposed to make a Magento system aware of packages installed via composer/firegento?

That is — most of the tutorials I've found cover setting up a composer.json file, and I've managed the without a problem.  I can install packages into vendor to my heart's content.

They'll also mention adding the following to your composer.json so "[something]"  knows where to install the modules

"extra":{
    "magento-root-dir":"./"
 }

However, what I haven't been able to figure out with the existing documentation is what command do I need to run in order to copy or symlink the files in ./vendor into my Magento root?

The tutorials I've found say use the magento-hackathon/magento-composer-installer project on GitHub — but this project's README seems more focused on creating your own packages than on basic usage.


texts: How to access the Magento API from native client with JavaScript

texts:
I need to access the Magento API from a local JavaScript based application (Titanium Desktop) and wondering what's the best way to do so.

What I found out so far:

The only authentication mechanism is OAuth, so the user has to enter their credentials on site
There is a JavaScript client library: https://code.google.com/p/oauth/source/browse/#svn%2Fcode%2Fjavascript
For native apps as OAuth clients, the OAuth 2 User Agent Flow is recommended.
The redirect URL has to point to a local page from where the token has to be extracted or copy&pasted

Questions:

Is it feasible to exchange the authentication mechanism to something like HMAC based authentication with application key and secret? Are there even proven solutions?
If not, is the OAuth User Agent Flow possible with Magento? The documentation does not mention it.
Is it possible to submit the user credentials with AJAX (Cross-Origin-Policy is not an issue here) to hide most of the authorization process from the user? The access token could then possibly be extracted directly from the response.


texts: Customer account navigation link store specific

texts:
As the title states, I need to add a link to the customer account navigation menu just for one store view of the website.

I tried doing it in this way, in the customer.xml file, with no luck:

<customer_account translate="label">
    Customer My Account (All Pages)
    ...
    <reference name="left">
        <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
            <action method="addLink" ...
        </block>
    </reference>
    <STORE_english>
        <reference name="customer_account_navigation">
            <action method="addLink" translate="label">
                    returns
                    <path>returns</path>
                    <title>returns</title>
           </action>
        </reference>
    </STORE_english>

</customer_account>


texts: Difficulty with simple javascript in Magento

texts:
My customer is wanting in Magento 1.9 for it to be required that the shipping estimate form on our site is filled out before checking out. To do this, we wanted to set the visibility option of the checkout button to none and then an action will make it visible.  In this case for test purposes I have a simple test button.

The code I am using is:

<button type="button" id="checkout" style="display:none;" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout"><?php echo $this->__('Proceed to Checkout') ?></button>

You need to fill out Sales & Freight Charges box to continue checkout.

<button onclick="checkoutwordsfunction()">Button Test</button>

If I put this in a basic HTML page, the function changes the display of the objects and the alert box runs. When I put this into part of the Magento template, all together in one spot, I press the button and only the alert box pops up.

Any thoughts or help that can be provided would be appreciated.

Thanks!


texts: Magento 2.3: One or more indexers are invalid

texts:
We are facing a problem with Magento 2.3 in indexers we tried a lot to fix it without any solution
You could see from the next screenshot that Reindex Required

We tried to edit our Cron job to fix the problem without any solution, below screenshot from our cron job

Could anyone help us in this issue, considering that we are using cpanel and don't have any access on SSH, we are using Magento 2.3, and we using php 7.2
Thank you in advance


texts: When to use Underscore.js vs Knockout.js for JS templating in M2?

texts:
I see that core M2 uses both Underscore.js and Knockout.js, although it looks like M2 core has extended base Knockout and added some new functionality to it.

If I am building something that binds data from a JSON object retrieved through an AJAX call, and updating the site based on the data, which library should I use for templating and why?


texts: Error Showing in Console "X-XSS-Protection: 1; mode=block, 1; mode=block: expected semicolon" in Magento2

texts:
Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block: expected semicolon at character position 13. The default protections will be applied.
I am using Apache Server.
How to resolve it.

A solution below Can anyone explain correctly
X-XSS-Protection header gets set twice - override XssProtection.php


texts: How to Auto Select Swatch Option Values if Only One Exists on Magento 2.1 Product View

texts:
I'm trying to have swatch option values selected on the Product View page, if only one value exists.

If the user selects a product from the Category page, the product page displays with the attributes Color, Shape, and Size. Some products only have one color, one shape, and maybe two sizes. I want the color and shape values to be automatically selected when that page loads.

Thanks!


texts:
I am trying to load a custom JS script on the Magento admin panel login page (Magento version 1.7.0.2).

As per the accepted answer in Issue adding javascript to magento admin page, I added the following lines to app/design/adminhtml/default/default/layout/local.xml:

<adminhtml_index_login>
  <reference name="head">
    <action method="addJs"><script>dev/test.js</script></action>
  </reference>
</adminhtml_index_login>

Note: the above code was added inside the existing <layout></layout> tags.

I cleared the cache but it does not add the dev/test.js file to the HTML header.

What is wrong with my code and/or implementation method?

Update 2018-03-06:

Tried the following in app/design/adminhtml/default/default/layout/main.xml but the result is the same (file not added to login page):

<?xml version="1.0"?>
<layout>
  ...
  <adminhtml_index_login>
    <reference name="head">
      <action method="addJs"><script>test.js</script></action>
    </reference>
    <block type="core/text_list" name="root" output="toHtml">
      <block type="adminhtml/template" name="content" template="login.phtml">
        <block type="core/text_list" name="form.additional.info" />
      </block>
    </block>
  </adminhtml_index_login>
  ...
</layout>


texts:
i'm getting this cron install error, how can i fix it?thankyou!!

php bin/magento cron:install --force

Fatal error: Uncaught Error: Call to a member function getMessage() on null in /home/XXX/public_html/vendor/magento/framework/Crontab/CrontabManager.php:202


texts:
How to get root category details like name, id, URL, imageurl, description. I write some code but I don't get the description and image url. My code is

$_categories = Mage::getModel('catalog/category')->getCollection()
                 ->addAttributeToSelect('name')
                 ->addAttributeToSelect('is_active')
                 ->addUrlRewriteToResult();

foreach($_categories as $_category):
$catUrl = $_category->getUrl($_category);
$catName = $_category->getName($_category);
$catId = $_category->getId($_category);
$catDescription = $_category->getDescription();
$catImageurl = $_category->getImageUrl();
endforeach;


texts: How to add a CMS page to Magento in a category subdirectory rather than in the root directory?

texts:
Is it possible to add a CMS page to a magento store, so that the URL is as follows:

www.example.com/category/CMS

At the moment, all I seem to be able to do is:

www.example.com/CMS


texts: how to display Custom attribute admin in product grid in magento1.9

texts: I have created a custom attribute cms_pid. Now I want to show the value of the attribute in my magento admin product grid. how can I achieves this?


texts: Apply a Magento Security Patch using GIT

texts: I'm new to GIT and Applying Security Patches. What is the most efficient way to apply a Magento Security Patch using GIT? Do I just push it to Magento's root directory and then use SSH to install it? I'm a bit confused because because looking at commit history it looks like other developers pushed difference files? Lastly, I have a total of 4 security patches to install. Should I commit them individually? or as a group?  Thank you for any clarification.


texts:
In my custom module, I have a admin grid which I added through extending the Mage class Mage_Adminhtml_Block_Widget_Grid.

Now I have a requirement that the above created grid should be wrapped in a form. After referring core files, I found that I can do this by extending Mage class Mage_Adminhtml_Block_Widget_Form. So, I did the same as follows:

<?php
class Namespace_Module_Block_Adminhtml_Form extends Mage_Adminhtml_Block_Widget_Form{
    protected function _prepareForm(){
        $form = new Varien_Data_Form(array(
                        'id'        => 'edit_form',
                        'action'    => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
                        'method'    => 'post',
                        'enctype'   => 'multipart/form-data'
                    )
        );
        $form->setUseContainer(true);
        $this->setForm($form);
        return parent::_prepareForm();
    }
}

After adding the above file, I called this form in __construct of Grid.php of my custom module:

public function __construct()
{
    parent::__construct();
    /* other code here */
    $this->setDestElementId('edit_form');  //I think this should wrap the grid in form. (not sure)
}

Still the Admin grid is not being wrapped in a Form.

I am trying to wrap the grid in Form so that I can submit the form with the values checked items as params. Here is the screenshot for clarification:

I added the Save button by extending the Mage class Mage_Adminhtml_Block_Widget_Grid_Container

public function __construct()
{
    /* other code here */
    $this->_addButton('save', array('label'=> 'Save'));
}

or Is it the correct way to approach?

Please help


texts: Mage.php not sending headers code line 766

texts:
I'm new to both Magento and PHP. I'm using Magento CE 1.9 on a local server for testing for an upgrade to 1.9. When I load onto the localhost the following error appears -

Cannot send headers; headers already sent in C:\wamp\www\magento\app\Mage.php, line 766

Trace:
#0 C:\wamp\www\magento\lib\Zend\Controller\Response\Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 C:\wamp\www\magento\app\code\core\Mage\Core\Model\App.php(1246): Zend_Controller_Response_Abstract->setHeader('Content-Type', 'text/html; char...')
#2 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(80): Mage_Core_Model_App->getResponse()
#3 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(202): Mage_Core_Controller_Varien_Front->getResponse()
#4 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 C:\wamp\www\magento\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#6 C:\wamp\www\magento\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#7 C:\wamp\www\magento\index.php(87): Mage::run('', 'store')
#8 {main}

If I look at myphpadmin and copy the code from Mage.php near line 766 -

  765 if (is_readable($localConfigFile)) {
  766              $localConfig = simplexml_load_file($localConfigFile);
  767              date_default_timezone_set('UTC');
  768              if (($date = $localConfig->global->install->date) && strtotime($date)) {
  769                  self::$_isInstalled = true;

This is the text from my local.xml in notepad -

<config>
    <global>
        <install>
            <date><![CDATA[Tue, 21 Aug 2012 16:37:58 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[fca5389338fe4588362c923c9abdff25]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[root]></username>
                    <password><![]></password>
                    <dbname><![CDATA[magento]]></dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[files]]></session_save>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[site_admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>


texts:
help, what will be the ajax url if
method is in:
/app/code/core/Mage/Adminhtml/controllers/CmsBlockController.php ?


texts:
I've created a CMS Page.

URL Key = about/page1.

I've created some Categories. One of them, category #1, it's called about.

URL Key = about

and its first subcategory, category #2, is named Page

URL Key = page1.

I want both categories to redirect to about/page1 CMS page.

My understanding is that I'll have a system rewrite:

from category/1 to catalog/category/view/id/1  and
from category/2 to catalog/category/view/id/2.

What URL Rewrites I'd need to add for redirecting both categories to my CMS Page? So if I click on both category links, the page about/page1 is opened?


texts: How to get the Description to the product quick view page?

texts:
I have to display description on product list view page, But I want to display description to click quick view popup page.

plz, check image?