texts: Magento 1.9 Why checkout_cart_product_add_after observer is not working?

texts:
I'm trying to execute the following Method with the Observer in my Magento module. But it isn't working and I don't know why.

This is my config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <TimgMage_CustomAddToCart>
      <version>0.0.1</version>
    </TimgMage_CustomAddToCart>
  </modules>
  <global>
    <models>
      <TimgMage_CustomAddToCart>
        <class>TimgMage_CustomAddToCart_Model</class>
      </TimgMage_CustomAddToCart>
    </models>
    <events>
      <!-- START: Add to cart actions -->
      <checkout_cart_product_add_after>
        <observers>
          <timgmage_customaddtocart_model_observer>
            <class>TimgMage_CustomAddToCart_Model_Observer</class>
            <method>checkoutCartProductAddAfter</method>
            <type>singleton</type>
          </timgmage_customaddtocart_model_observer>
        </observers>
      </checkout_cart_product_add_after>
    </events>
  </global>
</config>

And the observer

<?php

    class TimgMage_CustomAddToCart_Model_Observer
    {

        public function checkoutCartProductAddAfter(Varien_Event_Observer $observer) {

            Mage::log('Entered to checkoutCartProductAddAfter.', null, 'timgmage.log');

            /* @var $item Mage_Sales_Model_Quote_Item */
            $item = $observer->getQuoteItem();
            if ($item->getParentItem()) {
                $item = $item->getParentItem();
            }

            // Discounted 25% off
            $percentDiscount = 0.25;

            // This makes sure the discount isn't applied over and over when refreshing
            $specialPrice = $item->getOriginalPrice() - ($item->getOriginalPrice() * $percentDiscount);

            // Make sure we don't have a negative
            if ($specialPrice > 0) {
                $item->setCustomPrice($specialPrice);
                $item->setOriginalCustomPrice($specialPrice);
                $item->getProduct()->setIsSuperMode(true);
            }
        }
    }

Please anybody can help me.


texts:
I would love to be able to convert magento's compass to using bourbon.  so that i can use libsass to do faster scss compile.  Also I just like bourbon better.

How can this be accomplished?

I was taking a look at this to help me https://moovwebconfluence.atlassian.net/wiki/display/TS/Converting+Compass+based+projects+to+LibSass+and+Spracker


texts: How to join product collection of magento 2 to a custom table?

texts:
I have a custom table user_product_table with a field sku(this field join to product collection) and user. How can I join this table with product collection, so that I don't have to loop my custom collection to get product in each row.

My $userCollection:

 $userCollection = $this->_userProductFactory->create()
        ->getCollection()
        ->addFieldToFilter('user', 2);

My product Collection:

$productColelction = $this->_productCollectionFactory->create()
        ->addAttributeToSelect(array('name','image','short_description','sku'))

I would like to have final collection both my custom table fields and selected product attributes.


texts: How to Enable Advanced Search While Creating Custom Attribute

texts:
I have create custom attribute programatically,  these are the fields,

  $eavSetup->addAttribute(

        \Magento\Catalog\Model\Product::ENTITY,
        'myattribute',/* Custom Attribute Code */
        [
            'group' => 'Product Details',/* Group name in which you want to display your custom attribute */
            'type' => 'text',/* Data type in which formate your value save in database*/
            'attribute_set' =>  'myattribute',
            'backend' => '',
            'frontend' => '',
            'label' => 'Address', /* lablel of your attribute*/
            'input' => 'textarea',
            'class' => '',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'visible' => true,
            'required' => false,
            'user_defined' => true,
            'default' => '',
            'searchable' => true,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => true,
            'used_in_product_listing' => true,
            'unique' => false
        ]
    );

I need to enable Advanced Search while creating Custom Attribute in programatically, if i set  'searchable' => true' only enable Use in Search field, but not enable Visible in Advanced search.

Reference:

Suggest me How to enable this programatically.


texts: No response from magento after installation

texts:
I am trying to run Magento 2 from a clean install on a containerized environment, with nginx frontend and Magento itself running on php-fpm on backend.
When I try to do curl to the Magento url, I get nothing. Here is the verbose output from curl:
# curl 10.110.86.121/index.php
bootstrap2:/var/www/html/app|

[root@worker-0 ~]# curl -v 10.110.86.121/index.php
* About to connect() to 10.110.86.121 port 80 (#0)
*   Trying 10.110.86.121...
* Connected to 10.110.86.121 (10.110.86.121) port 80 (#0)
> GET /index.php HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.110.86.121
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.17.10
< Date: Tue, 23 Mar 2021 10:50:09 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< X-Powered-By: PHP/7.2.34
<
* Connection #0 to host 10.110.86.121 left intact

I was able to confirm that nginx does relay the requests to the backend. I edited pub/index.php on the php-fpm container, and I was able to see the echo that I inserted there in the curl response:
magentoRoot/pub/index.php:
$bootstrap = Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);
echo "test!";   // <=== I added this

So even when I added the echo at the end of index.php, I was still able to see it on the curl response.
I don't see any errors in logs. I even uncommented the ini_set('display_errors', 1); line in app/bootstrap.php.
I think that there is something weird with the bootstrap or the installation. I found Bootstrap magentoRoot/vendor/magento/framework/App/Bootstrap.php I edited run() function, and I was able to see the output in curl.
I enabled magento developer mode, and still there is no response in curl.
I added echo to magento2/lib/internal/Magento/Framework/App/Http.php launch() function on $this->_response variable, and apparently there is some response:
HTTP/1.1 302 Found
Location: http://magento2.local/index.php/
Pragma: no-cache
Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Expires: Mon, 23 Mar 2020 14:43:33 GMT
X-Magento-Cache-Control: max-age=0, must-revalidate, no-cache, no-store
X-Magento-Cache-Debug: MISS

What should I do next? Any idea why the magento output is empty?


texts: Minicart is not displaying quantity of preadded products after login

texts: products are displaying after login on cart page but there quantity is not displaying at minicart after login. but if I add new product or remove old product than quantity is updating in minicart. Is anyone have any solution for this problem in magento2 ?


texts: catalog/product_new no longer displays anything

texts:
So, I've been using this as a New Arrivals part of my home page to display those products that have the most recent 'Set Product as New From Date' and 'Set Product as New To Date' parameters set up. I've been using this on our new website for over a month, and it was working fine until yesterday, when it just started not displaying any products anymore.

The code on the home page is:

<div>{{block type="catalog/product_new" template="webandpeople/smartcatalog/list-new.phtml" image_width="150" image_height="150" column_width="170" products_count="8"  cache_lifetime="1"}}</div>

Using Grayscale Full-width 2014 theme. Magento 1.7.0.2. I've already checked to make sure cache has been flushed. The ONLY thing I did recently was to add a new category that was partially hidden from certain customer groups (using the Netzarbeiter Extensions Groups Catalog 2 extension), but I even deleted that new category and reflushed cache again. Still doesn't display any new products with that code.


texts: Copying dynamic custom options to quote item, order item

texts:
I have an observer that is adding dynamic custom options to the product detail page, which is called on the catalog_controller_product_view event. This allows the customer to select from a dropdown of their existing license codes.

public function addLicenseOptions(Varien_Event_Observer $observer) {
    $product = $observer->getEvent()->getProduct();
    if ($product->isSubscriptionProduct()) {
        $optionModel = Mage::getModel('catalog/product_option')
            ->setTitle('License Code')
            ->setProductId($product->getId())
            ->setStoreId($product->getStoreId())
            ->setId('license_code')
            ->setType('drop_down')
            ->setPrice(null)
            ->setPriceType(null)
            ->setIsRequire(true);

        $customer = Mage::getSingleton('customer/session')->getCustomer();
        if ($customer->getId()) {
            $linksPurchased = Mage::getResourceModel('downloadable/link_purchased_collection')
                        ->addFieldToFilter('customer_id', $customer->getId());

            if ($linksPurchased->count() > 0) {
                foreach ($linksPurchased as $linkPurchased) {
                    $valueModel = Mage::getModel('catalog/product_option_value')
                        ->setTitle($linkPurchased->getData('key_code'))
                        ->setProduct($product)
                        ->setOption($optionModel)
                        ->setId($linkPurchased->getData('license_code'))
                        ->setPrice(null)
                        ->setPriceType('fixed')
                        ->setSku(null);
                    $optionModel->addValue($valueModel);
                }
                $product->setHasOptions(1);
                $product->addOption($optionModel);
            }
        }
    }
}

But, when I place the order, the selected options are only saved in the info_buyRequest. Is there a way to get it to save as if it were a product option created in the admin?


texts: Magento 2 : Ghost Images From Magento Website are Trying To Be Loaded

texts:
I used keycdn to setup a cdn for my magento 2 website before I moved over to cloudflare but I'm having a strange issue ever since I made switch and I'm not sure how to fix it. You can view this error when going to my website at www.ooples.com and using developer console. The errors are also visible when you use incognito mode. That subdomain no longer exists.

Steps I have taken so far:

Flushed Cloudflare cache completely
Deleted local cache and cookies
Checked magento configuration and nothing is there from before

Any ideas or pointers on what I can do to fix this?


texts:
I want to add add to cart button without reloading the page.

For this I found this Excellence extension. But I have a problem when I add the product in cart, my minicart from top page is not updating. I found this in the code:

success: function(data){
    jQuery('#ajax_loader').hide();
    //alert(data.status + ": " + data.message);
    if(jQuery('.block-cart')){
        jQuery('.block-cart').replaceWith(data.sidebar);
    }
    if(jQuery('.header .links')){
        jQuery('.header .links').replaceWith(data.toplink);
    }
}

and my HTML output is look like this:

                        My Cart:
                        1 prekės
                        Price:
                        13,74 €

Is there any way to make this extension to update my top cart?


texts: Magento 2.x Migration Final Sync 'Delta' Stage when not Migrating from Live Database

texts:
In the middle of a Magento 1.6.2 to Magento 2.x migration.
I made a duplicate of the 1.6 store/database and migrated the data from that database to the new one. That was probably about 2 weeks ago after I sorted out all kinds of data migration problems. The duplicate 1.6 database has the tables added by the migration tool. In order to move ahead I would have to update the duplicate 1.6 database with the new data from the live 1.6 store and then do the delta migration to Magento 2. I'm not sure if this is possible. Or do I need to start over and migrate directly from the live site/database? If you have a method for this, please advise. Thanks.


texts: I can't reach interaktingslider in Magento

texts:
I try to help out a friend with his webshop and like to add an image to the interaktingslider ( with hyperlink to a page on the webshop). It looks like the interaktionslidertab edittab,or add new slidetab are not active. Clicking those 3 tabs they give a page not found 404.

I'd like to update the whole slider through magento connect manager. Hoping we can reach the slider like this way.
But also this magentoconnect manager page gives this note:

Forbidden
You don't have permission to access /downloader/?return=https%3A%2F%2Fwww.somename.nl%2Findex.php%2Fsomenameadmin%2F on this server. www.somename.nl

What could be wrong. It's the webshop of a friend of mine..we've both the adminstrator role.

Magento version is 1.9.2.2
And..i don't have acces to the files yet..so no cpanel available for me.

The developer doesn't do magento websites anymore and is not very willing to help.

I hope for some answers how to reach the slider again.

Thanks for helping in advance.


texts: Percentage discounts using cart price rules being calculated incorrectly

texts:
I'm running a Magento instance of 2.3.6-p1 using PHP 7.3 and having issues with Magento not calculating the discounts correctly.
How I tested

Set discounts to be applied before tax in the admin
Set up a cart price rule for 15% ( Apply Percent of product price discount)
Add multiple of products into your basket and apply the coupon code
List item

Below is a screenshot from the Magento admin with the incorrect values highlighted

Below is a table with what I believe to be is the correct logic and highlighted cells where I believe Magento is wrong

Below is a screenshot of how tax is setup in the admin

If I update the "Tax Calculation Method Based On" in the admin from "Total" to "Row Total" in Grand total inc tax is still 1p out
If I update the "Tax Calculation Method Based On" in the admin from "Total" to "Unit Price" the Grand total is correct (£53.25) but as you can see in the screenshot below the discount and taxes are all different even when the product prices are the same

Has anyone had any issues like this before and can advise of a fix?


texts:
I'm creating my first Magento module, the goal of which is to run some code at specified time invervals (e.g. using the Magento Cron).

However, I'm just trying to keep it simple first of all and add something to the Magento Log so that I know the code is executing when the cron job is run.

At the moment, I'm getting no messages in var/log/system.log when I'm expecting to see a message "Running Ultra Notification Import".

Here is my code:

app/code/community/Trueshopping/UltraNotificationImport/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Trueshopping_UltraNotificationImport>
            <version>0.1.0</version>
        </Trueshopping_UltraNotificationImport>
    </modules>
    <crontab>
        <jobs>
            <ultra_notification_import>
                <schedule><cron_expr>* * * * *</cron_expr></schedule>
                <run>
                    <model>ultranotificationimport/observer::import</model>
                </run>
            </ultra_notification_import>
        </jobs>
    </crontab>
</config>

app/code/community/Trueshopping/UltraNotificationImport/Model/Observer.php

<?php

class Trueshopping_UltraNotificationImport_Model_Observer
{
    /**
     * Import notifications from Ultra
     */
    public function import()
    {
        Mage::log('Running Ultra Notification Import');
    }
}

app/etc/modules/Trueshopping_UltraNotificationImport.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Trueshopping_UltraNotificationImport>
            <active>true</active>
            <codePool>community</codePool>
        </Trueshopping_UltraNotificationImport>
    </modules>
</config>

Thanks!

Anthony


texts: Generate the block with two ifconfig condition in layout xml

texts:
I prepared a code which masks the phone field. Since on some of our customer's website the customer does not enter input for phone field on register page, i need to put second condition to render this block apart from the "module enabled flag"
On customer_address_edit page the phone field is always required but on register page it is optional.
What is the best practice to do that ?


texts:
Magento 2.3

After adding a sentence to the main description and adding information to the short description on the product pages of admin, these changes do not display in the front end.

I've flushed the cache and re-indexed the indexer.


texts: File in Pub Directory Not Updating in Magento 2

texts: I have updated a .js file in pub directory and run cache:flush. But when I open website/filename.js in browser and incognito browser, it still load the old file. The permission to pub directory is already 777. I have also run cache:clean, setup:upgrade, di:compile, and static-content-deploy but still load the old file.


texts: Can anybody explain how quotes and cart work in magento? Where the cart or quote is assigned to customer? Are any events and which are doing that. I need to disable (assign) under certain conditions. I can create new quote, add product, update product and delete product until I want to proceed to checkot. Then my quote in table sales_flat_quote is updated by customer who in currently logged in.


texts: How to set Dynamic Lable in Order Summary when check out cart in Magento2?

texts:
This 'Charge'(label) is coming from checkout_index_index.xml file
  code:-

<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Abc_Xyz/checkout/cart/totals/fee</item>
<item name="title" xsi:type="string" translate="true">Charge</item>
</item>


texts:
SQLSTATE[23000]: Integrity constraint violation: 1022 Can't write; duplicate key in table 'quote_address', query was: CREATE TABLE
  quote_address

can any body explain this error?


texts: Add Backorder attribute to product grid at Admin side

texts:
I need to add the Backorder attribute on the Product grid admin side programmatically.
I installed amasty Pre Order Extension for Magento 2. But we can't filter the pre-order item on the product grid. So I need to add this programmatically on Magento 2.
Thanks.


texts: I have ERP and connector, where I need to connect order with my magento order. For that I've created erp_order_id inside magento. And now I need to create custom API V1 method - setErpId (which will set ID from ERP to erp_order_id field in magento), since there only addComment, cancel, hold, etc.. Can anyone help? Never did this before..


texts: Printing shipping labels creates the following error: Add Package Create Packages The XML document is well formed but the document is not valid

texts:
I get the following code back from UPS:

[result] =>
<?xml version="1.0"?>
<ShipmentConfirmResponse>
  <Response>
    <ResponseStatusCode>0</ResponseStatusCode>
    <ResponseStatusDescription>Failure</ResponseStatusDescription>
    <Error>
      <ErrorSeverity>Hard</ErrorSeverity>
      <ErrorCode>10002</ErrorCode>
      <ErrorDescription>The XML document is well formed but the document is not valid</ErrorDescription>
      <ErrorLocation>
                <ErrorLocationElementName>AccessRequest/AccessLicenseNumber</ErrorLocationElementName>
      </ErrorLocation>
    </Error>
  </Response>
</ShipmentConfirmResponse>
[__pid] => 17123
)

The XML I am sending is the following:

    <?xml version="1.0"?>
    <AccessRequest xml:lang="en-US">
  <AccessLicenseNumber></AccessLicenseNumber>
  <UserId></UserId>
  <Password></Password>
    </AccessRequest>
        <?xml version="1.0"?>
        <ShipmentConfirmRequest xml:lang="en-US">
      <Request>
            <RequestAction>ShipConfirm</RequestAction>
            <RequestOption>nonvalidate</RequestOption>
          </Request>
      <Shipment>
        <Description>Botron B62350 Green Dissipative 2 L</Description>
        <Shipper>
      <Name>Company name</Name>
      <AttentionName>first last</AttentionName>
      <ShipperNumber></ShipperNumber>
      <PhoneNumber>9999999999</PhoneNumber>
      <Address>
          <AddressLine1>21601 N 21st Ave</AddressLine1>
          <AddressLine2></AddressLine2>
          <City>Phoenix</City>
          <CountryCode>US</CountryCode>
          <PostalCode>85027</PostalCode>
          <StateProvinceCode>AZ</StateProvinceCode>
          </Address>
    </Shipper>
        <ShipTo>
      <AttentionName>first last</AttentionName>
          <CompanyName>test</CompanyName>
      <PhoneNumber>6236809173</PhoneNumber>
      <Address>
          <AddressLine1>11829 W Monte Lindo Ln</AddressLine1>
          <AddressLine2></AddressLine2>
          <City>Sun City</City>
          <CountryCode>US</CountryCode>
          <PostalCode>85373</PostalCode>
          <StateProvinceCode>AZ</StateProvinceCode>
          </Address>
    </ShipTo>
        <Service>GND</Service>
        <Package>
      <Description>Botron B62350 Green Dissipative 2 L</Description>
      <PackagingType>2c</PackagingType>
      <PackageWeight>
            <Weight>3</Weight>
            <UnitOfMeasurement>LBS</UnitOfMeasurement>
          </PackageWeight>
      <ReferenceNumber>02
            <Value>Order #100000002 P1</Value>
          </ReferenceNumber>
    </Package>
        <PaymentInformation>
      <Prepaid>
            <BillShipper>
          <AccountNumber></AccountNumber>
        </BillShipper>
          </Prepaid>
    </PaymentInformation>
      </Shipment>
  <LabelSpecification>
        <LabelPrintMethod>GIF</LabelPrintMethod>
        <LabelImageFormat>GIF</LabelImageFormat>
      </LabelSpecification>
</ShipmentConfirmRequest>

I see that AccessLicenseNumber is blacnk, as is user ID and password and shipper number. But I don't see a place to put those things in the magento shipping settings page so I am a bit confused if they are even required and / or if that's the reason I am getting errors. Any ideas?


texts: How to fix error in File Upload Custom Options Product?

texts: I have this error after try to upload a image in simple product on Magento 1.9.2.3. This option is a custom option inserted in simple product. Can anyone help me solve this problem?


texts:
I created one module and i want to add js file to that module but in DOM i am getting "404 not found" my file are
My\Helloworld\view\frontend\requirejs-config.js

var config = {
    map: {
        '*': {
            test1: 'My_Helloworld/js/test1'
        }
    },
};

My\Helloworld\view\frontend\web\js\test1.js

define([
    "jquery"
], function($) {
    "use strict";
    $(document).ready(function(){
        alert('Test JS');
    });
});

My\Helloworld\view\frontend\templates\helloworld.phtml

<script type="text/javascript">
    require(['jquery','test1'],function($){
        $(window).load(function() {
            $('.flexslider-8').flexslider({
                animation: "fade",
                controlNav: "thumbnails",
                slideshowSpeed: 2000,
                minItems: 2,
                maxItems: 4
            });
        });
    });
</script>


texts: How change texts in the Login and register pages

texts: I am using Magento 2 and the Mr Bara template, I have managed to change the home and product view, but I can not find where to change the login and registration texts, I want to add an image as well and that should be done in the template . Has anyone managed to do it? Thanks


texts:
when I am using the plugin on the home page this error is coming
We're sorry, an error has occurred while generating this content.
I have debugged my code I think there is an error in these two lines

<?php
    $url = 'https://api.instagram.com/v1/users/' . $userId . '/media/recent/?access_token=' . $accessToken.'&count='.$imageNumber;

    $args = stream_context_create(array('http' => array('timeout' => 2500,)));

any help will be appricated


texts: Special Price not displaying on Wishlist

texts:
UPDATE - This is a reported isue in v2.1 but there is not fix for it.

In Magento 2 special prices do not seem to be displayed on the Wishlists page.

Is it possible to display these? How? Is there any reason why they would not be displayed here?

See images below, the €12 discount is shown on the product page and not the wishlist page.

Is this possible with layoutXML, when I look in wishlist_index_index.xml I see:

<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">wishlist_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>

I know I can use similar LayoutXML in my theme, but what would I need to add to change it?

So far I've tried variations of the below, but it doesn't change anything:

<referenceBlock 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">wishlist_configured_price</argument>
        <argument name="price_label" xsi:type="boolean">false</argument>
        <argument name="zone" xsi:type="string">item_list</argument>
    </arguments>
    <arguments>
        <argument name="price_render" xsi:type="string">product.price.render.default</argument>
        <argument name="price_type_code" xsi:type="string">final_price</argument>
        <argument name="display_msrp_help_message" xsi:type="string">1</argument>
        <argument name="zone" xsi:type="string">item_view</argument>
        <argument name="id_suffix" xsi:type="string">copy-</argument>
    </arguments>
</referenceBlock>

Wishlist Page

Product Page


texts:
I've created a child theme by adding files to C:\xampp\htdocs\magento\app\design\frontend\Magento\themename

In this, I have a theme.xml file, a registration.php file, web folder, media folder and a Magento_Theme folder.

My question is as follows:

This child theme is using the C:\xampp\htdocs\magento\vendor\magento\theme-frontend-blank structure. For my homepage, how would I change the header file for example? It has a top menu, a search and a logo. How would I be able to re-arrange this?

Or even the homepage. How would I make a new layout for this, to maybe have a 3/5 column of normal content and 2/5 content of the latest products (As an example)?

Any directions would be awesome!


texts: How do I change a zero price to TBC on the category view

texts: I have a number of products in a category but 2 of them have a 0.00 price which I need hiding (just the price not the product) in the category view. How do I do this?


texts:
I am using social login plugin for connect with my site. Its working fine, but I want to remove its mark like Powered By XYZ. I have tried display none with its class and id but it did not work because all part

<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery(".ajay iframe").contents().find("#branding").attr("style","display:none");
    });
 </script>


texts: Magento Showing incorrect sales order report

texts:
I am using Magento 1.9.3.1.

Magento is showing incorrect sales order report. Some orders are not considered into Magento sales order report.

I have total 5 orders on 13 June and in the report, it is showing only 3 and also the order total is also wrong.


texts: How to manage stock availibility (in_stock or outof_stock) of product with Undo cancellation of order

texts:
I am trying to develop undo cancelled order extension. For that I am extending  OrderController.php.

    class Extension_Undocancel_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Controller_Action
{
    public function undocancelAction()
    {
        $id = $this->getRequest()->getParam('order_id');
        $order = Mage::getModel('sales/order')->load($id);
        $items = $order->getItemsCollection();

        try {
            foreach($items as $item) {
                $canceled = $item->getQtyCanceled();
                if($canceled>0) {
                    $productUpdates[$item->getProductId()] = array('qty' => $canceled);
                }
                $item->setData('qty_canceled',0);
            }
                Mage::getSingleton('cataloginventory/stock')->registerProductsSale($productUpdates);
                $items->save();

            $order->setBaseDiscountCanceled(0)
                ->setBaseShippingCanceled(0)
                ->setBaseSubtotalCanceled(0)
                ->setBaseTaxCanceled(0)
                ->setBaseTotalCanceled(0)
                ->setDiscountCanceled(0)
                ->setShippingCanceled(0)
                ->setSubtotalCanceled(0)
                ->setTaxCanceled(0)
                ->setTotalCanceled(0);

            $state = 'new';
            $status = 'processing';

            $order->setStatus($status)
                ->setState($state)
                ->save();

            $this->_getSession()->addSuccess($this->__('Order was successfully uncancelled.'));
        }
        catch (Mage_Core_Exception $e) {
            $this->_getSession()->addError($e->getMessage());
        }
        catch (Exception $e) {
            $this->_getSession()->addError($this->__('Order was not uncancelled.'));
        }

        $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
    }

}

It works fine even update product stock as per canceled quantity but If product quantity become zero it still show in stock.

How I can update stock availability if qty becomes zero?


texts:
I am trying to change my store base URL but it's not working.

Currently the base URL is set to my installation dir http://ns999999.ovh.net/magento/

I'd like to change it to a domain's name such as http://www.my_domain_name.com/
(which is redirected towards current_base_URL/index.php/)

When I do the change, I get blank pages, both for admin and front-end.
I did clear the var/cache and var session directories.

Can someone help me resolving this issue ? Any help would be greatly appreciated.


texts: Can't connect to Mysql with Magento 2/PHP 7

texts:
I'm working on a local build consisting of Magento 2.0 and PHP 7.  I've got everything up and running, but when I try to load the site I get the following error:

SQLSTATE[HY000] [2003] Can't connect to MySQL server on '192.168.2.102' (13) "/var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()

I realize that's a pretty straight forward error, but I can't figure out why I'm getting it because everything I've checked would seem to say that it would work.

I've confirmed that the pdo_mysql and PDO extensions are installed.
I've confirmed that PDO and pdo_mysql are enabled and showing correctly in phpinfo();
I've confirmed that PDO has pdo_mysql listed as a driver for it in phpinfo();
I've confirmed that I can connect to the DB using mysql on the command line
I've confirmed that the DB credentials in Magento's config are correct

I noticed that mysqli was installed instead of mysql when I do 'yum install php70w-mysql'. Did some research on php.net and found that it had been removed because it was crazy old and replaced with mysqli.  I tried disabling mysqli since I want to use pdo_mysql and was wondering if there was a conflict,but got the same exception message about not being able to connect.

Any thoughts on why Magento can't connect to the DB?

System specs are:
Centos 6.7
Apache 2.2.15-47
PHP 7 w/ mod_fastci
PHP 7 FPM
Mysql 5.7
Magento 2.0

Relevant parts of phpinfo();

mysqli

MysqlI Support => enabled
Client API library version => 5.1.72
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0
Client API header version => 5.1.73
MYSQLI_SOCKET => /var/lib/mysql/mysql.sock

Directive => Local Value => Master Value
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off

PDO

PDO support => enabled
PDO drivers => mysql, sqlite

pdo_mysql

PDO Driver for MySQL => enabled
Client API version => 5.1.72

Directive => Local Value => Master Value
pdo_mysql.default_socket => /var/lib/mysql/mysql.sock =>     /var/lib/mysql/mysql.sock

EDIT 1: I wrote a test script to see if I can connect via PHP to the database and it worked perfectly.  However, I dropped the test script into my doc root and called it in my browser and got the same can't connect error.  Would that be an issue with FastCGI or with FPM and any ideas what it's doing?  Test script is below.

<?php

    $host = '192.168.2.102';
    $user = 'ezp2_user';
    $pass = 'admin123';
    $dbname = 'klein';

    try{
        $conn = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
        $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        $query = $conn->prepare("select * from core_config_data limit 10");
        $query->execute();

        print_r(json_encode($query->fetchALL()) . "\n");
    } catch(PDOException $e){
        echo "Error: " . $e->getMessage();
    }

    $conn = null;

?>

EDIT 2: I changed the SAPI that I was using from FastCGI over to mod_php and got the same error.  So I think I can rule out FastCGI and FPM as a source of the problem.  So I'm thinking that leaves PHP as the final culprit.  Thoughts?


texts: How to fix One or more indexers are invalid. Make sure your Magento cron job is running?

texts: I am new to magento platform and I have installed magento on a shared linux server and when I logged into my admin panel I saw this message and I don't know how to set cron jobs on my linux server.


texts:
I have installed the Events Calendar extension magento connect on my shop.
The language set on the shop is cyrillic (Macedonian) so the calendar view(months, days of the week) is showing symbols text. Does somebody know how to translate the calendar to the language?


texts: Installing Magento2 Extension over SSH (terminal)?

texts: How to install magento2 extension over SSH?


texts: Magento 2 Logo not showing in the front end

texts: I have setup fresh magento 2 app on local. When i update the logo it's not reflecting on homepage .. when uploading the log it automatically create website folder and placed the logo inside that folder. It has to uploaded on logo folder .. Is there anyone have an idea about this issue


texts: Get stock data for grouped products in Magento 2

texts: How to get grouped product stock in Magento 2? If it uses parent product's quantity, then how can I get the default qty which is set while grouping?


texts:
override addressrepository.php for hide last name validation (using plugin)

Vendor/magento/module-customer/Model/ResourceModel/AddressRepository.php

anyone knows explain me


texts:
How can I update stocks in Dataflow - Profiles?

I have created a csv with the data (see image):

When trying to import it via "Import Product Stocks" then an error shows:

Skip import row, is not valid value "" for field "type"

Any idea what the problem might be?


texts: Magento 2.3.x setup:upgrade fails after sample-data installed

texts:
I have a clean Magento 2.3.2 in docker container.
After I installed sample data with bin/magento sampledata:deploy I cannot run setup:upgrade anymore even with --keep-generated parameter:

Module 'Magento_ConfigurableSampleData':
Running data recurring...Required parameter 'theme_dir' was not passed

After I remove sample data setup:upgrade works good.

I'm on Ubuntu16, the issue is not reproduced in Windows docker.

We have here a lot of answers about 'theme_dir' but I don't have any custom theme and I did not change anything in configuration nor installed any custom modules so that I decided to post a new question.

UPD:
The issue had gone away when I stopped magento cronjobs. Probably it was about file permissions or some kind of locks or indexer issues.


texts:
Magento2 How to add row pattern/dynamic rows to the custom product attribute.

Here is the sample output


texts: 403 Forbidden error for "Collect In Store Checkout Shipping Option"

texts:
Request your help to sort following error.

I am trying hands on on “Collect In Store Checkout Shipping Option”.

While I am trying to install extension with steps mentioned ahead I get error mentioned below

REDIRECTED URL:
http://connect20.magentocommerce.com/community/Pook_CollectInStore/

ERROR:

Forbidden
You don’t have permission to access url on this server.
Apache/2.2.3 (CentOS) Server at connect20.magentocommerce.com Port 80

Steps:

Accessed following EXTENSION PAGE URL
http://www.magentocommerce.com/magento-connect/collect-in-store-checkout-shipping-option.html
Ticked check box : I agree to the extension license agreement.
Clicked button : Get Extension Key
This showed text box with URL
Clicked Select Key to select URL, copied it and pasted to new browser window. Hit Run / enter to browse URL
Page gave ERROR : 403 Forbidden
You don’t have permission to access url on this server.


texts:
I am receiving this error with an extension. I think this is related to the last patch 8788, anyone know how to solve it?

the error points me here

  var uploader = new Flex.Uploader('optionextended_link_'+selectId+'_file', OptionExtended.Config.uploaderUrl, this.uploaderConfig)

thanks


texts: Magento 1.9 - Product collection sort by price not working fine

texts:
This is my product collection.

$collectionWithRank = Mage::getResourceModel('catalog/product_collection')
    ->addCategoryFilter($cat_data)
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('sort', ['neq' => ''])
    ->addAttributeToSort('sort', 'asc')
    ->addAttributeToSort('entity_id','desc');
    $collectionWithRank->load();

$collectionWithoutRank = Mage::getResourceModel('catalog/product_collection')
    ->addCategoryFilter($cat_data)
    // ->addAttributeToSelect(array('name', 'price', 'image', 'collect', 'url_key', 'sort'))
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('sort', ['null' => true])
    ->addAttributeToSort('created_at', 'desc')
    ->addAttributeToSort('entity_id','desc');
    $collectionWithoutRank->load();

$merged_ids = array_merge($collectionWithRankids, $collectionWithoutRankids);
$collection = Mage::getResourceModel('catalog/product_collection')
    ->addFieldToFilter('entity_id', array('in' => $merged_ids))
    ->addAttributeToSelect('*');
$collection->getSelect()->order(new Zend_Db_Expr('FIELD(e.entity_id, ' . implode(',', $merged_ids).')'));

if($sortby = "price_h_to_l"){
    $collection->getSelect()->reset(Zend_Db_Select::ORDER);
    $collection->addAttributeToSort('price', 'desc');
}

Above code affecting the product collection, where the price sort results are as below.

Product 1 - $7000
Product 2 - $6800
Product 3 - $5000
Product 4 - $200
Product 5 - $4800

The order by is not as expected.

Can anyone help to sort out this?.


texts: What happened with Magento 2 Service Layer?

texts:
As far as I remember, there were a lot of talks about importance of Magento 2 Service Layer and many services with different methods we had out of the box. When I downloaded the latest build, I was noticed that a lot of services were gone. For example, the built in CatalogInventory module has a service where you were able to collect different data. The service is still described in the official wiki: http://goo.gl/A7mVr8. But currently the method getProductStockStatusBySku() was moved from the service to the model and the service was completely removed. The same situation with many other built in modules.
The Magento Service Layer philosophy/purpose has changed?


texts: Redirect customers to login page from home page in Magento 2

texts:
I want to redirect my store customers to custom login page when a customer visits my magento 2 store url. The customer could not access the site till he login to the store.

How could I do that in Magento 2.3.x?


texts: How to Add captcha in COD method in Checkout page in magento 1.x &2.x?

texts: How to add captcha in payment method..appreciate for reply.


texts: Multiple Orders with Fake Emails. Is it Fraud?

texts:
I noticed something fishy going on with my store over the past week. We have an affiliate module setup (Affiliate Plus) on our store. Recently we've been getting a bunch of orders that are using the discount code of one particular affiliate account. They register when they checkout. Everything looks legit except the email. The addresses and CCV2s match every time, but I'm still suspicious. The monies are actually delivered via paypal to my account. I ship the orders and they (so far) are being delivered. I'm thinking about suspending the account and doing some more investigating.

Has anyone else experienced this? What are the risks associated with letting the orders continue?


texts:
Below is the my config.xml file

<resources>
                <categoryrestrict_setup>
                    <setup>
                        <module>Exinent_Categoryrestrict</module>
                        <class>Mage_Catalog_Model_Resource_Setup</class>
                    </setup>
                    <connection>
                        <use>core_setup</use>
                    </connection>
                </categoryrestrict_setup>
                <categoryrestrict_write>
                    <connection>
                        <use>core_write</use>
                    </connection>
                </categoryrestrict_write>
                <categoryrestrict_read>
                    <connection>
                        <use>core_read</use>
                    </connection>
                </categoryrestrict_read>
            </resources>

and my upgrade file name is upgrade-1.0.0-1.0.1.php but it is not working


texts: Add block from custom module to CMS page not working

texts:
I created a module with a simple phtml file.
Then i created a CMS page, and in the design tab a added this code:

<reference name="content">
 <block type="oproduct_export/infoshow" name="block"  template="oproduct_export/export.phtml" />
 </reference>

and also this:

{{block type="oproduct_export/infoshow " name="custom" template="oproduct_export/export.phtml"}}

export.phtml it's in the right place.
What it's the most courious thing, it's because i have the same thing on my local, and everything works fine, and my phtml appears in the cms page, but when I put all of the code on the server, the phtml doesn't appears.

I also created another modules and for any custom modules with custom phtml that I created, is not  working on the server.
If I add an existent magento block in my cms page, this phtml works fine and it appears on the cms page.

Does anyone know where it's my problem?


texts: How to use Different themes for Mobile App & site

texts:
I am new to Magento and I am planning to create a mobile app for my store. Since I cannot build or afford a mobile app for myself, I am planning to build a mobile app that simply redirects to my website but with different theme that I would like to use to make more easy for app users.

If anyone know how this can be done please help me.


texts:
I've been studing for the Magento certification and I came across a question in the swiftotter practice exam that said:

Can someone explain me why the answer I chose is incorrect? I thought the way you changed a block´s layout was with the answer I selected.

Thanks!


texts:
My current config.xml:

<?xml version="1.0"?>
    <config>
<modules>
    <inchoo_orders>
        <version>0.0.3</version>
    </inchoo_orders>
</modules>

<adminhtml>
    <layout>
        <updates>
            <orders>
                <file>inchoo/orders/orders.xml</file>
            </orders>
        </updates>
    </layout>
</adminhtml>

<global>
    <models>
        <inchoo_orders>
            <class>Inchoo_Orders_Model</class>
            <resourceModel>inchoo_orders_resource</resourceModel>
        </inchoo_orders>
    </models>

    <resources>
        <inchoo_orders_setup>
            <setup>
                <module>Inchoo_Orders</module>
                <class>Mage_Core_Model_Resource_Setup</class>
            </setup>
        </inchoo_orders_setup>
    </resources>

    <blocks>
        <inchoo_orders>
            <class>Inchoo_Orders_Block</class>
        </inchoo_orders>
    </blocks>

    <helpers>
        <inchoo_orders>
            <class>Inchoo_Orders_Helper</class>
        </inchoo_orders>
    </helpers>
</global>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <inchoo_orders before="Mage_Adminhtml">Inchoo_Orders_Adminhtml</inchoo_orders>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

 </config>

My current layout file orders.xml:

<?xml version="1.0" ?>
  <layout>
<default>
<!--<adminhtml_orders_index>-->
    <reference name="js">
        <block type="core/template" template="inchoo/orders/inline-edit.phtml"/>
    </reference>
<!--</adminhtml_orders_index >-->
</default>
</layout>

layout file location:
/app/design/adminhtml/default/default/layout/inchoo/orders/orders.xml
template file location: /app/design/adminhtml/default/default/template/inchoo/orders/inline-edit.phtml

What I would like to achieve is according to the tutorial instead of inserting js into  keep it in phtml.
(I can add into  but then there is a problem with url in ajax as tutorial author mentioned).

Help! Please!
I tried almos all possible combination to make it work :(


texts: Magento2 and Varnish always delivers (flash) messages

texts:
I just setup a test installation for Magento2 using Varnish 3. All seems to work fine but one thing is really strange:

If i register a new account i got the messages box telling me "Thank you for registering with Main Website Store.". This is fine on the first redirect, when registration is completed. But it always is showing up on any page.

The div container with class "page messages" is still getting delievered to the browser.

I used the default.vcl from the Magento backend, copied it to /etc/varnish/default.vcl (as this file is used by starting varnish). Is there anything else to do like the old -p esi_syntax=0x2 and cli_buffer? I used em both, but still i got this messages.

EDIT: I have opened a new browser incognito window and out of sudden in the incognito window i can't reproduce this 'error'. But still happening in the normal window, which wasn't closed all the time.


texts: Need Complete Updated Tutorial For Magento

texts:
I have WordPress expertise. But I need to learn magento from beginner level. Please give me anyone a proper link where I can get the updated Tutorial For Magento. It should be free of cost.

Thanks


texts: OnePage Checkout Page Wrong Totals After Product Save

texts:
This has proved to be quite the challenge to solve!  I am working on a Magento site with a multi-store setup with custom shipping and totals calculations using extensions and a OnePage checkout.  I have encountered an issue that googling around for has yielded no helpful hints.  Everything is working great except for two scenarios occur when a product is modified in the backend and I strongly feel they are related:

Scenario 1:

Customer has a product in the cart in the front end
The same product is modified in the backend in the store view the customer is in
When the customer goes to the OnePage checkout, the product shows in the cart review but the Product Total and Grand total are zero
Refreshing the checkout page recalculates the totals correctly; the zero totals only appear the first time the customer reaches the checkout page after the product is saved in the backend

Scenario2:

Customer has a product in the cart in the front end and is on the checkout page
The same product is modified in the backend in the store view the customer is in
When the customer removes the product from the cart, the product is removed from the cart summary but the Product Total and Grand total remain at what they were when the product was in the cart.  Even a now empty cart will still show the old total before the product was removed.
Refreshing the checkout page recalculates the totals down to zero; the product totals only appear the first time the checkout page is rendered after the customer removes the cart item

Unfortunately, I cannot post code as this is a heavily customized system but I hope someone might give me a clue as to what may be the issue so I know at least where to dig.

My investigation so far shows that, after a product save, Magento loads the core OnePage checkout controller rather than the custom checkout controller.  It appears to be related to a preDispatch event that is fired by dispatch() in app/code/core/Mage/Core/Controller/Varien/Action.php only after the product is modified in the backend since the backtrace for the checkout starts with:

First time after product save:

app/code/core/Mage/Checkout/controllers/OnepageController.php:62
app/code/core/Mage/Core/Controller/Varien/Action.php:407
app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:251
app/code/core/Mage/Core/Controller/Varien/Front.php:172
app/code/core/Mage/Core/Model/App.php:354
app/Mage.php:684
index.php:87

Any other time the checkout page is loaded:

app/code/local/path/to/custom/checkout/controller/...
app/code/core/Mage/Core/Controller/Varien/Action.php:418
app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:251
app/code/core/Mage/Core/Controller/Varien/Front.php:172
app/code/core/Mage/Core/Model/App.php:354
app/Mage.php:684
index.php:87

Any help with this would be greatly appreciated... In the very least a clue on where I should start looking ;)

Thanks!


texts: Slider extension is not showing in frontend

texts:
I've installed the Magestore Banner slider extension in my store and uploaded some slides in the backend via Banner Slider > Manage Banner but it's not showing on the homepage.

Any help and suggestions will be appreciated. Thanks


texts: Block override for new order creation not working

texts:
I have created a simple module which adds an indicator to the store selection form when creating a new order from the backend.

Example

As you can see it works, the problem is that it only works when you refresh this page, it does not work when you load in this page for the first time. (Sales > Orders > Create new order > [Select customer])

This defeats the purpose of what I'm trying to do here, making a quick and simple indicator that shows which store the customer registered in.

I have rewritten the core block:

Mage_Adminhtml_Block_Sales_Order_Create_Store_Select

adding these functions:

/**
* Retrieve quote session object
*
* @return Mage_Adminhtml_Model_Session_Quote
*/
protected function _getSession()
{
    return Mage::getSingleton('adminhtml/session_quote');
}

/**
 * Retrieve customer model object
 *
 * @return Mage_Customer_Model_Customer
 */
protected function getCustomer()
{
    return $this->_getSession()->getCustomer();
}

/**
 * @return string
 */
public function getCustomerCreatedIn()
{
    return $this->getCustomer()->getData('created_in');
}

So I can call getCustomerCreatedIn()in the template file:

app/design/adminhtml/default/default/template/sales/order/create/store/select.phtml

getCustomerCreatedIn() is supposed to get the customer's registered language. but this returns null on the first call, on the second time it's getting called it does return a value. I think this is happening because the session for the customer's order isn't loaded in at that moment yet, only after completing the second page load? This is where I'm stuck.


texts:
I have images that are not aligned despite a Python script I've created that Trims and Resizes the images (works on Watches and Jewelry and other standardized items). This is happening when items like bags have one image with the shoulder strap up and others with the shoulder strap down, which occupies different ratios of horizontal and vertical dimensions.

Aside from retaking the images so they are somewhat standardized (e.g all straps down), is there a way to make the images aligned?


texts: Unable to import custom less file in custom theme's modules in Magento2

texts:
I have created a custom theme in Magento 2 and I want to add _customvariables.less and _custommixins.less in all other less files.

I have added these files in the following location.

magento2/app/design/frontend/Vendor/theme1/Magento_Theme/web/css/source/_customvariables.less
magento2/app/design/frontend/Vendor/theme1/Magento_Theme/web/css/source/_custommixins.less

I have created separate less files for different areas like customer-account,cms-pages,category-pages,product-pages now when I tried to import _customvariables.less and _custommixins.less via following code

@import '../../../Magento_Theme/web/css/source/_variables.less';
@import '../../../Magento_Theme/web/css/source/_mixins.less';

I have got following errors in system.log

[2018-06-29 12:55:43] main.CRITICAL: File path 'magento2/app/design/frontend/Vendor/theme1/Magento_Cms/web/../../Magento_Theme/web/css/source/_variables.less' is forbidden for security reasons. [] []

When i try to run php -dmemory_limit=6G bin/magento setup:static-content:deploy -f then i found follwoing errors in cli

Compilation from source: magento2/app/design/frontend/Vendor/theme1/web/css/media.less . File path 'magento2/app/design/frontend/Vendor/default/web/../Magento_Theme/web/css/source/_custommixins.less' is forbidden for security reasons.

I am using Koala for less compilation it successfully compiles with the @import but when we clean the pub/static directory or deploy static content the CSS files are not created properly.

I have read this thread (How can I custom less file and compile less file in magento 2), but in my case the _custommixins.less and the files which imports are in different directories like

File which imports : magento2/app/design/frontend/Vendor/theme1/Magento_Customer/web/css/source/customer_acc.less
File which need to import : magento2/app/design/frontend/Vendor/theme1/Magento_Theme/web/css/source/_custommixins.less

Currently, I'm not using grunt/gulp.

Thanks


texts: Magento 2.2.5 change 'Add To Cart' button to 'View Product' at category page

texts:
Is it possible to change the 'Add To Cart' button to 'View Product' at the category pages? I have for almost every product some attributes, so it's weird for my visitors to click on "Add To Cart" but than go the the product with an alert that they have to choose the size and color..

Hope somebody can help me out!


texts:
Anyone have an idea of how to setup docker in ubuntu 16.04 for Magento2?
Also able to describe docket concept basic will be better.

Thanks


texts: We have had no success in exporting our 100k+ product list using Magento's standard export.  The export keeps timing out and we get a blank screen.  We have tried upping the memory allocation and also tried going to data profiles for all products to set the file to run in popup and save on the server.


texts:
In my top links i have my account, basket(cart) and contact us.

What i would like to do is when an item gets added to the cart by the customer:

the customer stays on the page they are instead of redirecting to the cart
and a drop down appears under the cart link in the header displaying "you have $number item/s in your cart" with a link to the cart page.

The redirection i sorted in the admin configuration. But im not sure on how to do the drop down for the cart link in top links. I ideally want it to look like this:

I only want it to do this when there are items in the cart though. When there inst any in the cart the link should look like normal

Any ideas? thanks


texts: Magento 2.2 Open Source restrictions on each setting

texts:
When using Magento 2.2 Open Source, is there a limit on the number of websites we can have?
Is there a limit on the number of SKU, attribute set, and attributes in Mgaento 2.2 Open Source?
When setting permissions with Magento 2.2 Open Source, can I select and set permissions on the website and store?
Insert a full page cache to improve page speed.
For example, on one page, we want to just clear the cache from one part of the page.
I would like to make improvements to adapt the cache on a per-block basis.
Currently in one magento, we have 4 Web sites | Store view. We use 3 sites for each (Japanese, English, Chinese).
Default is regarded as a mall, and each is shared to each individual Website and Default URL.
Now we have 4 stores, in the future we want to add in more sites, to around 20 to 30 more.
We would like to introduce POS system in which inventory information, product information, order information, customer information, point information, coupon information are linked fully with magento. Do you have an ERP or POS system compatible with Magento 2.2 Open Source?
Every day, there is work such as creating a detailed page of products that arrives and publishing, the person in charge then makes preparation for publication.

As we have more items piling up, the chances of human error gets higher, like forgetting to publish pages.
Does Magento 2.2 Commerce have a function to dynamically set the schedule for publishing?
is there a setting to publish the items with a time and date setting?
Everyday, as products are selling, we have to manually change and rearrange the items associated with the category.

Example / 1) When there are items out of stock, we move the item to the bottom of the category page.

Example / 2) When the attribute (season) associated with the product is new, we have to rearrange the item to be displayed on the top.

We sort the products associated with the category according to various conditions.
When rearranging products associated with categories, priorities are decided on the management screen, is there such a setting?
We currently sell products in e-commerce with 3 offline stores in Japan.
Sometimes its open to just the store front.
There are times a customer wants to come to our storefront to purchase something but wants to check the item on our EC site first and or see where and how many stocks are left.
As we have 3 shops, when creating the product page, is there a setting that can show where and how many stocks is left and at which shop?


texts: Error: "Frame callback host must be instance of Magento\Backend\Block\Widget" during Customer Edit

texts:
I am getting this error on customer edit page at the admin side:

  Frame callback host must be instance of
  Magento\Backend\Block\Widget

I am getting above error for few users only.


texts: Will Modifying Product Attribute Set Cause An Error

texts: We are sending products with api and also we are updating them with it. We had override _prepareDataForSave method for this reason. We are changing attribute_set in method. Is there a possibility to raise an error or break something?


texts:
I have install en_GB locale and deployed content with both:

  php bin/magento setup:static-content:deploy

and

  php bin/magento setup:static-content:deploy en_GB

I've also cleared cache and did:

  php bin/magento setup:upgrade

When inspected the code in frontend. I found that data is coming from

  pub/static/magento/frontend/Magento/luma/en_GB

However, frontend shows french locale. Is there anything else that i can do ?


texts: When using "set New password" for customer Magento sends email with admin password reset link

texts:
I am using Magento 1.8.1.0

When I use Password Management -> New password field in the Customers -> Manage Customers -> Account Information page for a single customer record the selected customer is sent an email with auto generated password using admin password reset email template, and all links in the above mentioned email point to domain.com/admin page. The password is changed, and user can log in from frontend using the password, both in cases where it is auto generated and set manually, but the link in the email is pure confusing.

This is clearly not the desired functionality. The template used in this case is /app/locale/en_US/template/email/password_new.phtml while it should have been a different template, or the links in this template should be different.

Does anyone else experience this problem? Namely, should I just update the template, or is this a problem in controller which selects the wrong template ?


texts: Which observer to call imidiately after customer registration to call my custom function?

texts:
I am checking in my custom controller if customer is logged in or not if the customer clicks on register after registration it should redirect to my custom controller and continue the process.
I am using customer_register_success it is executing but i am getting blank customer session in my custom function.Suggest me some solution.
This my custom function

 public function getcustomerdata()
   {
            if(Mage::getSingleton('customer/session')->isLoggedIn())
            {
                     $customerData = Mage::getSingleton('customer/session')->getCustomer();
                      echo $customerData->getId();
                       $name = $customerData->getFirstname();

            }
            return $name;

  }

My observer function is.

 public function doSomething($observer)
   {
       $AccountController = $observer->getEvent()->getAccountController();
        $Customer = $observer->getEvent()->getCustomer();

  $session=Mage::getSingleton('customer/session');
  $session->setBeforeAuthUrl(Mage::getSingleton("mymodule/session")->getCompurl().'state_new/1');
if (!$Customer->getCustomerActivated()) {
}
else{
   //$session->setCustomerAsLoggedIn($Customer);
   $response1 = Mage::app()->getResponse(); // observers have event args

    $dataarray = Mage::getSingleton("mymodule/session")->getData_array();
    $sampleid=$dataarray['sampleid'];

    $state=$dataarray['state'];
    if($state==1)
    {
      $collection=Mage::getSingleton('mymodule/mymodule')->customisesaved($sampleid);
    if($collection)
    {
        $url=Mage::getUrl('mymodule/mymodule/customshow');
         Mage::log($url,null,"url.log");
            Mage::app()->getFrontController()->getResponse()->setRedirect($url);
         Mage::app()->getResponse()->sendResponse();
         exit;
    }

}

}
}


texts: Show Product Meta Keywords in Product pages

texts:
Is there a way to show all meta keywords for a product on its product detail page. something looks like below?

I'm currently able to display the meta-keyword attribute values under the email icon( I added the following code at the end of the mailto.phtml).

        <?php echo $_product->getData('meta_keyword'); ?>

However, I want to display them like the image above ( in individual box) and move them underneath product title.


texts: Why is my hamburger menu not letting me have it my way?

texts:
Is this the suicide prevention hotline?  I sure hope so, because I've about had it with this cheeseburger.  Please, save a life and help me out.

I've searched through the questions and the most similar issues to mine are still not answered after many moons.

The website I am speaking of... has an exceptionally erratic hamburguesa menu.

Magento ver. 2.1.8

It pretty much never works on Chrome, regardless of the page you're on.  It sometimes works on Firefox.  Even on the same page, sometimes it works, sometimes not.

I'm assuming it has to do with script(s) not loading, but I'm too much of an amateur on Magento to get this narrowed down enough.  I've already spent more time than I'd like to admit.  I've also noticed that the search function doesn't show up when the hamburger doesn't work, but shows up when the hamburger works.  So it seems as though they are looking for the same script.

Sometimes when the hamburger works, the "Menu" and "Account" seem to be on top of one another.  I'm not sure if that could also be related.  Like I said, it is erratic as can be.

If I were smart, I would have checked on it to see what I did to make it stop working correctly, but I never claimed to be brilliant, and any changes that could have affected the menu was done far too long ago.

I'm not necessarily asking for an exact solution, but I know there are thousands of people on here that could probably take 3 minutes to inspect the code and instantly say, "well, there's your problem."  Or if someone could just point me in the right direction, I'd be tickled pink.

You can roast me for not asking a detailed enough question, but I truly believe this is about as thorough as I can be, given the circumstances.


texts: Magento 2 - Check if Cart Price rule is active for product

texts:
I am exploring the possibilities to show active Cart Price rules on a product page. For example, if I have a blue shirt in the category 'shirts' and I create a Cart Price rule for 20% discount on the category 'shirts', is it possible to check this for a product?

I'm trying to fetch all active cart price rules for a product. In the example of the shirt, I want to show 'Get 20% discount on all shirts' on that specific product page.

I explored the sales-rule module but did not find a possible solution. It should be possible right?


texts: Magento 2.1.8 Language Pack Only English is selected

texts:
I've created a Chinese and Japanese store views for my Magento store.

In storefont the options for Japanese and Chinese are displaying. However, when I click on Chinese or Japanese, only English option is getting selected.

May I know what am i doing wrong. I followed exactly as per Magento doco to create the store views. My main problem is why chinese/japanese options not getting selected when I click on them?


texts: Test site redirect to original site with HTTPS on

texts:
I have two MAGENTO 1.7 websites example.com and test.example.com. On test.example.com I do extension testing prior to live publishing on example.com. The problem is when I go to SETTING--> CONFIGURATION-->WEB---> change Secured and Unsecure Base url to https://test.example.com... my test site automatically redirect to original https://example.com website.

Basically I cannot turn on HTTPS on test website.... However I can use test website without SSL/ https, using standard HTTTP, such as http://test.example.com

I have wildcard ssl on example.com

Any suggestions how to turn on SSL on Test website?


texts: Default Captcha module is not working in Magento2

texts: I have enabled Captcha in Store > Configuration > Customers > Customer > Customer Configuration under this Captcha. I enabled this for my Contact Us form but it throwing error while submitting like Invalid Captcha but Captcha is not showing in the Front-end so please tell me I did anything wrong. I flushed cache too.


texts: Issue with Magento 2.2.4 - quotation mark in product name break product pages

texts:
I have just installed Magento 2.2.4 to try out and have so far noticed a few issues in my first half hour. Was wondering if this is just my custom installation or is happening for anyone else.

The product images alt attribute seems to be loaded asynchronously and appended under the product image. The product page seems to stop processing javascript just before this however breaking the page. This seems to fail if a quotation mark exists in the product name (e.g. 12" Ruler (30cm)) throwing the below error:

Uncaught SyntaxError: Unexpected token ( in JSON at position 129
at JSON.parse (<anonymous>)
at getData (main.js:58)
at Array.map (<anonymous>)
at HTMLDocument.apply (main.js:74)
at fire (jquery.js:3232)
at Object.add [as done] (jquery.js:3291)
at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)
at jQuery.fn.init (jquery.js:2967)
at new jQuery.fn.init (jquery-migrate.js:225)
at jQuery (jquery.js:75)

Switching the product name fixed the immediate issue however there are many items with quotation marks to change and want to solve this without changing product names.

It seems that quotations in product names are not being escaped for the breadcrumbs as logging the object just before the error shows below:

{
"breadcrumbs": {
    "categoryUrlSuffix": ".html",
    "useCategoryPathInUrl": 0,
    "product": "12" Ruler (30cm)"
}
}


texts: magento 2 create categories programmatically

texts:
I would like to create categories programmatically in magento 2.

Please suggest me proper code for it.

I have try this code Link but not working properly . I have to create number of categories on one code with sub-categoties. like import export.


texts: magento custom function to be used in all product detail pages

texts: i want to make a custom function to be used for product listing pages , where to create the function ??? ..


texts: Magento 2 difference between Object Argument replacement and Class Preference

texts:
Take the following code as example:

// Vendor\Namespace\Model\SomeClass
// ...
public function __construct(
    ExampleClass $object
{
    $this->object = $object;
}
// ...

I can use argument replacement to configure the object manager to use another class that inherits from ExampleClass in di.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <!-- ... -->
    <type name="Vendor\Namespace\Model\SomeClass">
        <arguments>
            <argument name="object" xsi:type="object">Vendor\Namespace\Model\AnotherExample</argument>
        </arguments>
    </type>
</config>

I can also configure a preference to replace the class:

<!-- .... -->
<preference
    for="Vendor\Namespace\Model\Example"
    type="Vendor\Namespace\Model\AnotherExample" />
<!-- ... -->

What is the difference between these two methods?


texts:
Whenever I open the WYSIWYG editor and try to add an image I get a bunnch of 403 errors in my chrome console and am unable to see the images.

GET https://www.example.com/media/wysiwyg/.thumbs/wysiwyg/homepage/parallax_banner_1.jpg?rand=1447169279 403 (Forbidden)

What's interesting is that I can still see the image in my browser window if I ammend the URL slightly by removing .thumbs/wysiwyg/ from the path:

https://www.example.com/media/wysiwyg/homepage/parallax_banner_3.jpg?rand=1447169279

I thought it could be a permissions issue but I tried setting media/wysiwyg/ to 777 recursively but the issue persists.

I'm running Magento 1.9.2.2 on an AWS EC2 instance, Ubuntu, NGINX.


texts: Why I still need to run setup:di:compile in developer mode?

texts:
Quick Intro

I'm working on a payment module and using Magento 2.3.2 (irrelevant).
As stated in many places, we don't need to run setup:di:compile when in developer mode (which is my scenario).

  As we know, once you run it for the first time, generated/code and
  generated/metadata folders are created and Magento runs in
  "compiled" mode instead
  (\Magento\Framework\App\EnvironmentFactory::getMode).

However, after deleting these folders, we should get it normal behaviour, and that's what I did.

The problem

After updating this payment module and going to checkout (/checkout) I always get an ajax error apparently related to dependency injection.

The error is visible in the html source as follows:


texts: Magento2 - How to remove certain States from list at Checkout or registration?

texts:
the list of region with depend country, i want to remove certain state from everywhere in site..

like I want to remove -  Alaska, Hawaii, American Samoa, Guam, Marshall Islands.

How we can achieve this?


texts:
I want to return more details about order, customer, product and shipping after order placement so can handle my own custom API. I have this code in successAction method in :
app/code/core/Mage/Checkout/controllers/OnePageController.php

public function successAction()
    {
        $session = $this->getOnepage()->getCheckout();
        if (!$session->getLastSuccessQuoteId()) {
            $this->_redirect('checkout/cart');
            return;
        }

        $lastQuoteId = $session->getLastQuoteId();
        $lastOrderId = $session->getLastOrderId();
        $lastRecurringProfiles = $session->getLastRecurringProfileIds();
        if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {
            $this->_redirect('checkout/cart');
            return;
        }

// start

        $order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());

        $customerID = $order['customer_id'];
        $customerFirstName = $order['customer_firstname'];
        $customerLastName = $order['customer_lastname'];
        $customerEmail = $order['customer_email'];
        $orderID = $order->getId();
        $shippingAddressID = $order['shipping_address_id'];

        foreach ($order->getAllItems() as $item) {

            $orders['orders']['items'][] = array(

                'productID'           => $item->getProductId(),
                'sku'                 => $item->getSku(),
                'orderedQty'          => $item->getQtyOrdered(),

            );

       echo "Product ID: ".  $item->getProductId()."<br/>";

       //send my api

        }

  //end

        $session->clear();
        $this->loadLayout();
        $this->_initLayoutMessages('checkout/session');
        Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
        $this->renderLayout();
    }

The problem is: there are another products returned. For more clear when I choose one product and do checkout then place order, I see my product and another product returned. how to prevent?


texts: how to assign the same value to column of custom grid?

texts:
I want to assign the same text to one column of  all rows of the Grid

I have my custom grid and I added column like this:

class Ailin_Orders_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
{  //somecode
     protected function _prepareColumns()
        {
            $helper = Mage::helper('ailin_orders');
            $this->addColumn('Vendor Code',
                array(
                    'header'=> Mage::helper('catalog')->__('Vendor Code'),
                    'width' => '50px',
                    'renderer'  => 'adminhtml/sales_render'
            ));
}
}

I created a file render.php to render the value simply like this:

class Ailin_Orders_Block_Adminhtml_Sales_Render
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    public function render(Varien_Object $row)
    {
        return "SCOZAH";
    }
}


texts:
How to use query to get result in Magento admin grid & set into collection?

$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query="MY_SQL_QUERY";
$result = $readConnection->fetchAll($query);
$this->setCollection($result);

This is showing error as Call to a member function setPageSize() on a non-object


texts:
I'm looking for a way to add configurable product to cart from catalog page. When i look demo theme site they all have customisation of product in catalog, itis a module ?

I find many solution on google but no one worked.

Also there is a way to set default configuration for product (the checkbox default in attribute don't work) i try with js but the image and price aren't updated.


texts: Can Magento Configurable Swatches be disabled if not used?

texts: I don't use Magento Configurable Swatches. Disabling via Mage_ConfigurableSwatches.xml, will this have any side effect? I am looking for performance improvement which I see if disabled.


texts:
In a store of mine, built on Magento 2.1.x I need to perform a bulk update on product SKUs.

I am thinking about doing an UPDATE directly on the DB, on the catalog_product_entity table, since I noticed that the SKU information is stored in this table.

Is it safe doing it? The SKU information is contained in other tables?


texts: Magento 2 : Image is taking too much time to display

texts:
How can I product image load time decrease? The product image is taking too much time to display on home page and all the pages.

Please help me to solve this issue.
Thanks in Advanced.


texts: Magento2, aroundSave event does not get triggered on product save

texts:
Considering below in di.xml, wondering why I do not see my message in blog after pressing save button on product page in admin panel.

in di.xml :

<type name="Magento\Catalog\Api\ProductRepositoryInterface">
        <plugin name="aroundProductSave" type="\mtVendor\myModule\Plugin\AroundProductRepositorySave"/>
</type>

in AroundProductRepositorySave.php :

public function aroundSave(
        \Magento\Catalog\Api\ProductRepositoryInterface $subject,
        \Closure $proceed,
        \Magento\Catalog\Api\Data\ProductInterface $product,
        $saveOptions = false
    ) {
        $this->log->debug("------------ in AroundProductRepositorySave -------------");

        /**
         * @var \Magento\Catalog\Api\Data\ProductInterface $result
         */
        $result = $proceed($product, $saveOptions);
        //return $result;

        return $subject->get($product->getSku(), false, $product->getStoreId(), true);
    }


texts: hide some section in admin panel magento 1.9

texts:
I want to hide some section of the admin panel > configurations

how to do that?
like there is a section called ( about us ) and it's the theme developer. I want to hide it. and some other things as well

magento 1.9


texts: Magento 2 rest api /V1/invoices/{id}/capture

texts:
I am posting data using /V1/invoices/{id}/capture but it is returning 'Request does not match any route'.

I am posting base url/rest/V1/invoices/5/capture also I have tried url/rest/default/V1/invoices/5/capture.

Can anyone suggest where I am wrong?


texts: Magento 2 add modal popup customer edit adminhtml

texts:
I am looking into way to implement modal popup that slides out inside customer account edit page with customer listing ui component as content.
Is there a way to implement this?


texts: Filter shipping methods based on order weight

texts:
Currently my shipping methods configuration is like this:

Free delivery (customer pays cash in the physical store and picks up
his goods)
Normal shipment (customers makes a bank transfer and gets his goods
with regular shipping prices. I used default table rates
"weight/destination").
Cash on delivery (customers gets goods via shipping service and pays
his goods to the delivery service. I used MatrixRate extension to
get another "weight/destination" table rate

For payment methods i configured only "Bank transfer payment" named "Payment" with instructions. I didnt use multiple payment methods here, because everything is defined with shipping method selection.

My first question is .... is this a good practise? Or should I consider another option... Basicaly the customer only needs to know the shipping fee... and the store owner in Magento can see information from selected shipping method.

But there are some filters I need to implement. The store owner wants "Cash on delivery" to be disabled in case total order weight is below 100. Can someone help me implement this filter, because I am not comfortable to use an extension just for this one filter.

Thank you in advance.


texts: Magento2 : Subscription status shows pending in advance reporting

texts:
I want to enable advanced reporting in Magento2.

To do this I go to Store->Configuration->General->Advance Reporting and enable it.

It have been 5 days but still subscription status shows pending.

Please check screenshot for reference

I have read this reference link: https://docs.magento.com/m2/ce/user_guide/reports/advanced-reporting.html

In Magento Doc It is mention in 5th point as below.

Wait overnight, or until after the time of your next scheduled update. Then, check the status of your subscription. If the status is still “pending,” make sure that your installation meets all of the requirements.

But I could not find out what this all requirements are.


texts: Magento1.9.2 how to set my pincode in top links

texts:
I have created custom module for the set pincode same pincode is used for calculate shipping rate/estimate shipping rate.

Code in template/page/template/links.phtml :

<?php $shippingblock = $this->getLayout()->createBlock('checkout/cart_shipping'); ?>

 My Pincode:<?php echo $shippingblock->escapeHtml($shippingblock->getEstimatePostcode()) ?>set pincode<input type="hidden" id="charge-sales-tax" value="">

My Custom controller  code

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->setCountryId('US')->save();
Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->setPostcode('27007')->save();

When I add product in the shopping cart then set my pin code it working fine.
But without adding product in cart then it won't work.

Please advice me.


texts: Magento 2 Pattern Library -- Date & Time Selectors

texts:
I would like to implement the "Horizontally Stacked Time Range Picker" from the Magento 2 Pattern Library into an admin form input

http://devdocs.magento.com/guides/v2.0/pattern-library/getting-user-input/date_time_selector/date_time_selector.html

Does anyone have any working examples of exactly how to do this? I scoured through the entire admin, but couldn't find any working examples of the date+time picker.


texts: How can I use Page Builder only on some WYSIWYG UI components in Magento 2?

texts: I have Page Builder enabled in the configuration settings, but on some WYSIWYG UI components I would like to use the regular TinyMCE editor. Is this possible at all? Thanks


texts: Custom admin module seperate form for edit and new

texts:
I am adding custom admin module for magento 1.8.
I have joined two table one is core_store_group and another one is my custom flat table
Its working fine, In new form I have 2 fields select box and file field, I am adding store_group_id and CSV file content to my custom flat table by iterating each time for CSV content.

Yes Now also its working fine.
I am facing problem in edit.
I am using same form to edit the product. That I don't want.
I need to display all the content while editing in two fields one is select
That is showing correct answer, second field while editing instead of file field I need to display text area to display data.

Following is my form code which display one select field and file field for both while edit and new

protected function _prepareForm()
    {
        $foundation = Mage::registry('foundation_data');
        $form = new Varien_Data_Form();

        $fieldset = $form->addFieldset('foundation_form', array('legend'=>Mage::helper('foundation')->__('Foundation Members')));

        $fieldset->addField('store_id', 'select', array(
          'label'     => Mage::helper('foundation')->__('Select Store'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'store_id',
          'values'   => Mage::helper('foundation')->getStoreOptionValues(true),
          ));
        $fieldset->addField('file', 'file', array(
          'label'     => Mage::helper('foundation')->__('CSV'),
          'class'     => 'desable',
          'required'  => true,
          'name'      => 'file',
        ));
        $this->setForm($form);
        $form->setValues($foundation->getData());
        if (Mage::getSingleton('adminhtml/session')->getFoundationData()) {
            $form->setValues(Mage::getSingleton('adminhtml/session')->getFoundationData());
            Mage::getSingleton('adminhtml/session')->setFoundationData(null);
        } elseif (Mage::registry('foundation_data')) {
            $form->setValues(Mage::registry('foundation_data')->getData());
        }
        return parent::_prepareForm();
    }

My question is how to display different form while edit and new?


texts: Magento 1 and Google cloud platform SQL: Mysqlserver has gone away

texts:
I would like to know if there's anyone in here having experience with google cloud SQL platform.

We are experimenting a very annoying issue which is very hard to troubleshoot.

Randomly, there's an "mysql server has gone away"  popping out.

Our architecture is using Compute engines machine connected to a google cloud SQL database.

We don't have that many possibility to customize the my.cnf, since it's a managed service.

Here is a copy of the show variables: https://pastebin.com/Xaswtt72

I will add an example of an incident and the corresponding screenshot in New Relic

As you can see, the connect takes forever. While i checked in the cloud SQL plateform logs, the CPU was not charged at all (less than 10%), neither the RAM/network/I/O

We know that our code can be highly optimized, for sure, but still, we don't understand why with such a oversized architecture (10 front servers, database has 8vcpu and 30go of ram, and 500GO of SSD storage) we are experimenting those kind of issues, specially when our website is not loaded that much (less than 60RPM average).

Google support can't find anything. If one of you would have any kind of lead it would be already a big help.

Thanks in advance!


texts: How to create upload image and videos attribute in Admin product detail page in Magento2.2.5?

texts:
I want to create image and video upload for in Admin Product page

Refer my screenshot:

Under Available in I have created a attribute aaa, Under aaa I should get images and videos upload like this.

Refer my screenshot:

Is this possible to achieve this.

Please someone guide me on this.

Any help would be appreciated.


texts: How to get Product Category name and Category ID on checkout success page?

texts:
I am looking for a way to get Category name and Category ID one the checkout success page. So far I have added the product name, sku etc but I am unable to get the category name and id

Here's my code to product attributes and category names:

<?php //
    $products = array();
    $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
    $_order = Mage::getSingleton('sales/order')->load($lastOrderId);

/* @var $item Mage_Sales_Model_Order */
foreach ($_order->getAllVisibleItems()  as $item) {
    $info['sku'] = trim($item->getSku());
    $info['qty'] = $item->getQtyOrdered();
    $info['price'] = $item->getPrice();
    $info['name'] = $item->getName();

    $products[] = $info;
}

    $product = Mage::getModel('catalog/product')->load($productId);
    $categoryIds = $product->getCategoryIds();
    $categoryName = '';
if (isset($categoryIds[0])){
    $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($categoryIds[0]);
    $categoryName['category'] = $category->getName();
}

$config['productInfos'] = $products;
$config['cartTotal'] = $_order->getGrandTotal();
$config['currency'] = Mage::app()->getBaseCurrencyCode();
?>

Here we echo out the values:

_roi.push(['_addItem',
    '<?php echo $product['sku']; ?>', // Merchant SKU
    '<?php echo $product['name']; ?>', // Product Name
    '<?php echo $categoryIds['categoryId']; ?>', // Category ID
    '<?php echo $categoryName['category']; ?>', // Category Name
    '<?php echo $product['price']; ?>', // Unit Price
    '<?php echo $product['qty']; ?>' // Item Quantity
]);

The issue is the CategoryIds and CategoryName are not showing and I'm stuck!

Anyone able to help please do?


texts: Cookiebot throwing console errors in Magento 2.3.4

texts:
I have added cookiebot script into head tag,

here is the script

<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="0000-0000-0000-0000" data-blockingmode="auto" type="text/javascript"></script>

After adding this script, I am getting are many console errors,

  Uncaught Error: Mismatched anonymous define() module: function ( $ ) {

Tried contacting support, but could not succeed in that, please advise me how to resolve this error,

Thanks in Advance!!


texts: Magento 2 Get custom attribute values in phtml

texts:
I want to populate attribute(Gender) values in select dropdown on listing page. On selecting specific value of the gender attribute, the product list should be filtered.

The gender attribute has 3 values

Male
Female
Others

For some products the attribute value is set to male and female as the product is unisex.

I want to know how can I get the values of attributes(male, female, others) irrespective of products.


texts:
I have created custom module with image upload attribute.Its working Good. But when i edit that row in a grid, After entered save button, image path saved as Array. So i cant get an image in grid and also in frontend.I have paste my code here

    if($_FILES['fileinputname']['name'] != '') {

try {
     $uploader = new Varien_File_Uploader('fileinputname');
     $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
     $uploader->setAllowRenameFiles(true);
     $uploader->setFilesDispersion(false);

     $path = Mage::getBaseDir('media').'/foo/';
    // move_uploaded_file( $_FILES['userFile']['tmp_name'], $path);
     $uploader->save($path, $_FILES['fileinputname']['name']);
     }
     catch (Exception $e) {
     echo 'Error Message: '.$e->getMessage();
}

I cant find what changes will i make here. Help me guys

EDIT

 public function saveAction()
{
    Zend_Debug::dump();
    if ($postData = $this->getRequest()->getPost()) {

        /// ---START code for save image attribute----
        if($_FILES['fileinputname']['name'] != '') {

try {
     $uploader = new Varien_File_Uploader('fileinputname');
     $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
     $uploader->setAllowRenameFiles(true);
     $uploader->setFilesDispersion(false);

     $path = Mage::getBaseDir('media').'/foo/';
    // move_uploaded_file( $_FILES['userFile']['tmp_name'], $path);
     $uploader->save($path, $_FILES['fileinputname']['name']);
     }
     catch (Exception $e) {
     echo 'Error Message: '.$e->getMessage();
}
}

$postData['fileinputname'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'foo/' .$_FILES['fileinputname']['name'];

//$data['popup_image'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'p_gallery/'. $_FILES['popup_image']['name'];

}
// --END---
        $model = Mage::getSingleton('foo_bar/baz');
        $model->setData($postData);

        try {
            $model->save();

            Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The baz has been saved.'));
            $this->_redirect('*/*/');

            return;
        }
        catch (Mage_Core_Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
        }
        catch (Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while saving this baz.'));
        }

        Mage::getSingleton('adminhtml/session')->setBazData($postData);
        $this->_redirectReferer();
    }
}


texts: Fetching all the cross sell product using rest api

texts:
Is their any rest api available for fetching all the cross sell product ? By using the below mentioned api we can fetch only cross sell product against a particular sku. But I want all the the products that are cross product of some particular product.

/V1/products/{sku}/links/{type}


texts: How to insert data into database table using upgradedata

texts:
I'm using Magento 2.2.5 and I have a data set that I want to insert to database using upgrade data or install data.

How can I do this?

Am I able to use object manager to call the model factory and insert it from there?


texts: How to Serialize and than retrieve Magento product image thumnail?

texts:
I am doing a fetch from product model,

    $collection = Mage::getModel('catalog/product')
                    ->getCollection()
                    ->addAttributeToSelect('name')
                    ->addAttributeToSelect('thumbnail')
                    ->addExpressionAttributeToSelect('query_text', '{{name}}', 'name')
                    ->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
                    ->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
                    ->addAttributeToFilter('name', array('like' => '%'.$this->getQueryText().'%'))
                    ->addAttributeToSort('name', 'ASC')
                    ->setPageSize(10)
                    ->addStoreFilter($this->getStoreId());

                     $data = serialize($collection->getData());
                     $data = unserialize($data);

Here I am serializing the getdata() from product collection, also before rendering on frontend I am unserializing it and looping on it for fetchinng product related info, but Ia m unable to get the product image thumbnail link when I am serializing and unserializing the collection data, when I just pass the collection object and do a loop I get all product info ( image too) .

foreach ($collection as $item) {
                print_r($item);
                $_data = array(
                    'title' => $item['query_text'],
                    'row_class' => (++$counter)%2?'odd':'even',
                    'img'=>$this->helper('catalog/image')->init($item, 'thumbnail')->resize(100),
                    'id'=>$item['entity_id'],
                );

                if ($item['query_text'] == $query) {
                    array_unshift($data, $_data);
                }
                else {
                    $data[] = $_data;
                }
            }

I am serializing the data for storing it in CACHE, any help on how to retrieve the thumbnail from unserialized serialized data ?

img'=>$this->helper('catalog/image')->init($item, 'thumbnail')->resize(100) //this is not working


texts: Custom option price not working with bundle product

texts:
I am using magewrox extension for custom options.
So what is the issue?

I am trying to create bundle product.
I add bundle items.
then I try to add custom options in it with different prices.
product saves successfully.

the issue is on product detail page. while I try to select a custom option then it's price is not updating in a cart.


texts:
Facing error while downloading the pdf file from the frontend link on the cloud server

Warning: file_put_contents(invoice-1574071311.pdf): failed to open stream: Read-only file system in file/path/Test.php on line 100


texts: How to hide a product in magento2 rest api?

texts:
I want the product not to appear on the site, but not delete ?

How to do it through the REST API ?


texts: Ajax customer login magento and wordpress

texts:
I am trying to login on both cms at once , ajax file is working in chrome, that is in magento root , but not working in firefox . any help appreciated .

jQuery('#mg_login').on('submit', function(e) {

                  var email= jQuery('#log').val();
                  var pwd= jQuery('#pwd').val();
                   alert("email--"+email+" password--"+ pwd);
                  jQuery.ajax({
            type: "POST",
            data: "password=" + pwd + "&email=" + email,
            url: "http://aaaaaaa/p/mg_cust_login.php",
            success: function (result)
            {

                         alert(result);

            }

        });

     });


texts:
I am using magento calendar in ui component form just like the way it is in the link given here.Magento 2 - How to add the DateTime UI Component

It works fine when I add a new record, but when I edit a record , the current date and time is shown/picked by the calendar,indeed the calendar field must show the datetime record saved in the database. Thus when I edit any records , the datetime value gets reset and current datetime is saved in the database.Is this a known bug?. Any help would be appreciated.


texts: Apache Virtualhost redirecting to first domain

texts: I have apache virtualhost configured properly.  Meaning when i go to www.myfirstsite.com it loads the welcome page i created for it, similarly when i go to www.mysecondsite.com it loads second welcome page.  This tells me everything is working properly.  The issue i have is when i transfer my magento site to www.mysecondsite.com it redirects to www.myfirstsite.com  What could be going wrong here?


texts: Image not imported from CSV in Magento 2.4

texts:
I want to import some product with images with CSV so i have add my image in
var/www/html/mag/var/import/images

folder with lamptest.jpg name and added filename with
base_image , small_image , thumbnail_image , swatch_image with lamptest.jpg name in both configurable and virtual product.

My product is imported with correct info. but image is not imported with this.
Anyone suggest me what's wrong with this.


texts:
I want to update my database table and I'm using ubuntu.
Following is my code,

$event = $observer->getEvent();
$orderId = $observer->getEvent()->getOrder()->getId();
$id = Mage::getModel('sales/order')->load($orderId);
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$customer = Mage::getModel('customer/customer')->load($id->getCustomerId());
$salesex = $customer->getSalesExecutive();
$query = "UPDATE sales_flat_order_grid SET sales_executive = ".$salesex." WHERE entity_id = " . $orderId;
//print $query; exit();
$write->mysqli_query($query);

When I print this query, it shows fine and well. But when I run it, it shows this error Fatal error: Call to undefined method Magento_Db_Adapter_Pdo_Mysql::mysqli_query()
How to do this?